Skip to content

Commit

Permalink
fix( #80 ): session keeps language data after user logout
Browse files Browse the repository at this point in the history
  • Loading branch information
DogukanUrker committed Jul 19, 2024
1 parent 8befdb0 commit 6c2f0b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions routes/logout.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ def logout():
Log.success(
f"User: {session['userName']} logged out"
) # Log a message with level 2 indicating the user has logged out
session.clear() # Clear the session dictionary
flashMessage(
page="logout",
message="success",
category="success",
language=session["language"],
) # Display a flash message
) # Display a flash message indicating the user has logged out
session.pop("userName") # Clear the userName data from session
session.pop("userRole") # Clear the userRole data from session
return redirect("/") # Return a redirect response to the homepage
case False: # If the user is not logged in
Log.danger(
Expand Down

0 comments on commit 6c2f0b7

Please sign in to comment.