Skip to content

Commit

Permalink
Check if user exists
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysanthos committed Jul 13, 2024
1 parent e928f4a commit f58a134
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Listeners/OtpListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ class OtpListener
{
public function clear(Logout $event)
{
Session::forget(
app(OtpService::class)->generateVerifiedKey($event->user)
);
if ($event->user) {
Session::forget(
app(OtpService::class)->generateVerifiedKey($event->user)
);

Session::forget(
app(OtpService::class)->generateOtpSentKey($event->user)
);
Session::forget(
app(OtpService::class)->generateOtpSentKey($event->user)
);
}
}
}

0 comments on commit f58a134

Please sign in to comment.