Commit 190e4760 authored by Mark Harding's avatar Mark Harding

(feat): set user guids of mobile too, use the Session class

parent eb3c70ee
No related merge requests found
Pipeline #77861750 waiting for manual action with stages
in 9 minutes and 21 seconds
......@@ -5,6 +5,7 @@ use Minds\Core;
use Minds\Core\Di\Di;
use Minds\Common\Cookie;
use Minds\Entities\User;
use Sentry;
/**
* Minds Session Manager
......@@ -96,6 +97,17 @@ class Session extends base
public static function setUser($user)
{
static::$user = $user;
// Update sentry with the current user
// TODO: Move to a delegate
if ($user) {
Sentry\configureScope(function (Sentry\State\Scope $scope) use ($user): void {
$scope->setUser([
'id' => (string) $user->getGuid(),
]);
});
}
if (!$user
|| !static::$user->username
|| static::$user->isBanned()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment