simplify error
authorMichael Wallner <mike@php.net>
Tue, 8 Oct 2019 13:32:59 +0000 (15:32 +0200)
committerMichael Wallner <mike@php.net>
Fri, 20 Dec 2019 12:21:59 +0000 (13:21 +0100)
app/Controller/Github/Callback.php
app/views/github/callback.phtml

index bd8c0e5abe6dc7f281aa894174f42bee95c194f0..2347d0e67069ca946dbea6c924af10e59b312f06 100644 (file)
@@ -23,9 +23,7 @@ class Callback extends Github
        
        function __invoke(array $args = null) {
                if ($this->app->getRequest()->getQuery("error")) {
-                       $this->app->getView()->addData([
-                               "error" => $this->app->getRequest()->getQuery("error_description")
-                       ]);
+                       $this->app->getView()->addData($this->app->getRequest()->getQuery()->toArray());
                } else {
                        $this->validateUser();
                        
index fae0bae05f94319ade0b5458e0ae16579e956bbd..dde4896309163b1685f0dbd3af908f59a8286dba 100644 (file)
@@ -1,2 +1,8 @@
 <?php $this->layout("layout") ?>
 
+<?php if (isset($error)) : ?>
+<div class="alert alert-warning">
+       <p><?= $this->e($error_description) ?></p>
+       <p>Github error: <a href="<?= $this->e($error_uri)?>"><?= $this->e($error) ?></a></p>
+</div>
+<?php endif; ?>