mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
example: fix expiration
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
This commit is contained in:
@@ -81,7 +81,7 @@ async def login(token: Annotated[str, Body(embed=True)]):
|
|||||||
status_code=status.HTTP_404_NOT_FOUND, content={"message": "invalid token"}
|
status_code=status.HTTP_404_NOT_FOUND, content={"message": "invalid token"}
|
||||||
)
|
)
|
||||||
username, expires_at = _tokens_to_username.pop(hashed_token)
|
username, expires_at = _tokens_to_username.pop(hashed_token)
|
||||||
if expires_at > now:
|
if expires_at < now:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
status_code=status.HTTP_400_BAD_REQUEST,
|
status_code=status.HTTP_400_BAD_REQUEST,
|
||||||
content={"message": "token expired"},
|
content={"message": "token expired"},
|
||||||
|
Reference in New Issue
Block a user