feat: implement refresh token functionality; update authentication and token models; add tests for refresh endpoint
Test / test (push) Successful in 13s
Test / test (push) Successful in 13s
This commit is contained in:
@@ -118,6 +118,9 @@ async def get_current_user(
|
||||
sub = payload.get("sub")
|
||||
if sub is None:
|
||||
raise credentials_exception
|
||||
scope = payload.get("scope", "access")
|
||||
if scope != "access":
|
||||
raise credentials_exception
|
||||
user_id = int(sub)
|
||||
except (jwt.PyJWTError, TypeError, ValueError):
|
||||
raise credentials_exception from None
|
||||
|
||||
Reference in New Issue
Block a user