aboutsummaryrefslogtreecommitdiff
path: root/middleware/authentication.py
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-08-30 20:30:04 -0400
committerBobby <[email protected]>2024-08-30 20:30:04 -0400
commit2ac4f44fc18c06df94f6afff8f775e7ee5de5308 (patch)
tree23ea5002bf983a780902e8ca48d0bfa712fdab40 /middleware/authentication.py
parent0d6aacd2ab38f0d91181b7880e896e2b98d18871 (diff)
downloadyugen-2ac4f44fc18c06df94f6afff8f775e7ee5de5308.tar.xz
yugen-2ac4f44fc18c06df94f6afff8f775e7ee5de5308.zip
watch history update + some general stuff
Diffstat (limited to 'middleware/authentication.py')
-rw-r--r--middleware/authentication.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/middleware/authentication.py b/middleware/authentication.py
index 5845036..7bd8a93 100644
--- a/middleware/authentication.py
+++ b/middleware/authentication.py
@@ -43,7 +43,7 @@ class AuthMiddleware:
)
if timezone.now() > verified_at + timedelta(hours=24):
# Verification expired, need to re-check
- raise ValueError("Verification expired")
+ pass
except (json.JSONDecodeError, ValueError):
# Cookie is invalid or expired, need to re-check
pass
@@ -57,6 +57,14 @@ class AuthMiddleware:
token_type=request.user.discord_token_type,
)
+ # update user object
+ request.user.usrname = user["username"]
+ request.user.discord_global_name = user["global_name"]
+ request.user.discord_guild_name = user["guild_name"]
+ request.user.save()
+
+ print(user, "user")
+
if not user["is_authorized"]:
logout(request)
request.session["next"] = request.get_full_path()