From d392ba821e3e6705af93925299f65381a23b313b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Apr 2020 11:54:47 +1100 Subject: [PATCH] Fixes for Sentry (#3581) --- app/Exceptions/Handler.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 5c9357ca75..2eb06fb1e3 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -60,10 +60,17 @@ class Handler extends ExceptionHandler app('sentry')->configureScope(function (Scope $scope): void { - if (auth()->user() && auth()->user()->account->report_errors) { + if(auth()->guard('contact')->user() && auth()->guard('contact')->user()->account->report_errors) { + $scope->setUser([ + 'id' => auth()->guard('contact')->user()->account->key, + 'email' => "anonymous@example.com", + 'name' => "Anonymous User", + ]); + } + else if (auth()->user() && auth()->user()->account->report_errors) { $scope->setUser([ 'id' => auth()->user()->account->key, - 'email' => auth()->user()->email, + 'email' => "anonymous@example.com", 'name' => "Anonymous User", ]); }