1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00

Fixes for Sentry (#3581)

This commit is contained in:
David Bomba 2020-04-02 11:54:47 +11:00 committed by GitHub
parent aefa6749af
commit d392ba821e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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",
]);
}