summaryrefslogtreecommitdiff
path: root/src/Exceptions
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-08 19:30:37 +0200
committermsquare <msquare@notrademark.de>2018-10-31 13:43:23 +0100
commitd15946df2dfb0ae2f0ca9371e5c8071df91ab45a (patch)
tree49601aafd74da5a781920543ed92bbd180fe5e89 /src/Exceptions
parent8e62c4c52c27f9432820915deeb699c3d1f58ce7 (diff)
Changed `src/` code and templates to use the new user model
Diffstat (limited to 'src/Exceptions')
-rw-r--r--src/Exceptions/Handlers/Whoops.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Exceptions/Handlers/Whoops.php b/src/Exceptions/Handlers/Whoops.php
index 630aca1d..72e97776 100644
--- a/src/Exceptions/Handlers/Whoops.php
+++ b/src/Exceptions/Handlers/Whoops.php
@@ -4,6 +4,7 @@ namespace Engelsystem\Exceptions\Handlers;
use Engelsystem\Application;
use Engelsystem\Container\Container;
+use Engelsystem\Helpers\Authenticator;
use Engelsystem\Http\Request;
use Throwable;
use Whoops\Handler\JsonResponseHandler;
@@ -81,9 +82,15 @@ class Whoops extends Legacy implements HandlerInterface
*/
protected function getData()
{
- global $user;
-
$data = [];
+ $user = null;
+
+ if ($this->app->has('authenticator')) {
+ /** @var Authenticator $authenticator */
+ $authenticator = $this->app->get('authenticator');
+ $user = $authenticator->user();
+ }
+
$data['user'] = $user;
$data['Booted'] = $this->app->isBooted();