Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #299 from meower-media/develop
Browse files Browse the repository at this point in the history
Temporarily remove token rotating
  • Loading branch information
tnix100 authored Sep 1, 2024
2 parents f12dfdd + 092c086 commit ac10cdf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions security.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ def create_user_token(username: str, ip: str, used_token: Optional[str] = None)
"content": "Your account was scheduled for deletion but you logged back in. Your account is no longer scheduled for deletion! If you didn't request for your account to be deleted, please change your password immediately."
}))

# Return original token if one is specified
# This is a temporary fix for people being randomly logged out
if used_token:
return used_token

# Generate new token, revoke used token, and update last seen timestamp
new_token = secrets.token_urlsafe(TOKEN_BYTES)
account["tokens"].append(new_token)
Expand Down

0 comments on commit ac10cdf

Please sign in to comment.