sessions: fix error when an anonymous user tried to logout.

Fix an exception when a user who was already logged out tried to logout
again.
This commit is contained in:
evazion
2021-01-23 18:22:43 -06:00
parent b6e06ee6fc
commit 9a9fbcc398
2 changed files with 12 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ class SessionLoader
def logout
session.delete(:user_id)
return if CurrentUser.user.is_anonymous?
UserEvent.create_from_request!(CurrentUser.user, :logout, request)
end