Skip to content

Commit

Permalink
Fixes #258 whereby logout fails if the JWT already being used has exp…
Browse files Browse the repository at this point in the history
…ired
  • Loading branch information
Max Snow committed Jul 16, 2024
1 parent 7e91edf commit 9680bb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/JWTGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ public function login(JWTSubject $user)
*/
public function logout($forceForever = false)
{
$this->requireToken()->invalidate($forceForever);
try {
$this->requireToken()->invalidate($forceForever);
} catch (JWTException $e) {
// Proceed with the logout as normal if we can't invalidate the token
}

$this->fireLogoutEvent($this->user);

Expand Down

0 comments on commit 9680bb8

Please sign in to comment.