We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ef9ac5 commit 472223aCopy full SHA for 472223a
1 file changed
src/Auth.php
@@ -757,13 +757,18 @@ public function verifyToken(string $token)
757
return null;
758
}
759
760
- $user = $this->find($decodedToken['user.email']);
+ $user = $this->find($decodedToken['user.id']);
761
762
if (!$user) {
763
$this->errorsArray['token'] = 'User not found';
764
765
766
767
+ if ($user->email !== $decodedToken['user.email']) {
768
+ $this->errorsArray['token'] = 'Invalid token';
769
+ return null;
770
+ }
771
+
772
return true;
773
} catch (\Throwable $th) {
774
$this->errorsArray['token'] = $th->getMessage();
0 commit comments