From d15946df2dfb0ae2f0ca9371e5c8071df91ab45a Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 8 Oct 2018 19:30:37 +0200 Subject: Changed `src/` code and templates to use the new user model --- src/Exceptions/Handlers/Whoops.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Exceptions/Handlers') 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(); -- cgit v1.2.3-54-g00ecf