From 092c08685cf903b829649c639508bd9edb7b5fde Mon Sep 17 00:00:00 2001 From: Tnix Date: Sun, 1 Sep 2024 12:16:40 +1200 Subject: [PATCH] Add files via upload --- security.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security.py b/security.py index e6799c5..ccea8a8 100644 --- a/security.py +++ b/security.py @@ -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)