Skip to content

Commit 472223a

Browse files
committed
fix: patch up user find on token verify
1 parent 1ef9ac5 commit 472223a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Auth.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,13 +757,18 @@ public function verifyToken(string $token)
757757
return null;
758758
}
759759

760-
$user = $this->find($decodedToken['user.email']);
760+
$user = $this->find($decodedToken['user.id']);
761761

762762
if (!$user) {
763763
$this->errorsArray['token'] = 'User not found';
764764
return null;
765765
}
766766

767+
if ($user->email !== $decodedToken['user.email']) {
768+
$this->errorsArray['token'] = 'Invalid token';
769+
return null;
770+
}
771+
767772
return true;
768773
} catch (\Throwable $th) {
769774
$this->errorsArray['token'] = $th->getMessage();

0 commit comments

Comments
 (0)