File tree Expand file tree Collapse file tree
{{cookiecutter.project_name}}/template_minimal/app/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ async def get_current_user(
4141 detail = "Could not validate credentials, cannot use refresh token" ,
4242 )
4343 now = int (time .time ())
44- if not now >= token_data .issued_at and now <= token_data .expires_at :
44+ if now < token_data .issued_at or now > token_data .expires_at :
4545 raise HTTPException (
4646 status_code = status .HTTP_403_FORBIDDEN ,
4747 detail = "Could not validate credentials, token expired or not yet valid" ,
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ async def refresh_token(
6262 detail = "Could not validate credentials, cannot use access token" ,
6363 )
6464 now = int (time .time ())
65- if not now >= token_data .issued_at and now <= token_data .expires_at :
65+ if now < token_data .issued_at or now > token_data .expires_at :
6666 raise HTTPException (
6767 status_code = status .HTTP_403_FORBIDDEN ,
6868 detail = "Could not validate credentials, token expired or not yet valid" ,
You can’t perform that action at this time.
0 commit comments