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

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
tnix100 authored Sep 1, 2024
1 parent e5a7704 commit 092c086
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 092c086

Please sign in to comment.