mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
check for deleted user on refresh
This commit is contained in:
parent
58ae223371
commit
1284704293
@ -183,6 +183,11 @@ def auth():
|
|||||||
# if the jwt cookie is expiring soon
|
# if the jwt cookie is expiring soon
|
||||||
elif jwt_source == "cookie" and expiration - JWT_REFRESH <= current_time:
|
elif jwt_source == "cookie" and expiration - JWT_REFRESH <= current_time:
|
||||||
logger.debug("jwt token expiring soon, refreshing cookie")
|
logger.debug("jwt token expiring soon, refreshing cookie")
|
||||||
|
# ensure the user hasn't been deleted
|
||||||
|
try:
|
||||||
|
User.get_by_id(user).execute()
|
||||||
|
except DoesNotExist:
|
||||||
|
return fail_response
|
||||||
new_expiration = current_time + JWT_SESSION_LENGTH
|
new_expiration = current_time + JWT_SESSION_LENGTH
|
||||||
new_encoded_jwt = create_encoded_jwt(
|
new_encoded_jwt = create_encoded_jwt(
|
||||||
user, new_expiration, current_app.jwt_token
|
user, new_expiration, current_app.jwt_token
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user