Skip to content

Commit

Permalink
add error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardSchwarzkopf committed May 18, 2024
1 parent 44762d3 commit ba13357
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse, RedirectResponse
from fastapi.staticfiles import StaticFiles
from jwt import ExpiredSignatureError, InvalidTokenError
from jwt import ExpiredSignatureError, InvalidSignatureError, InvalidTokenError
from starlette.exceptions import HTTPException
from starlette.middleware.sessions import SessionMiddleware
from starlette_wtf import CSRFProtectMiddleware
Expand Down Expand Up @@ -128,7 +128,7 @@ async def token_refresh_middleware(request: Request, call_next) -> Response:
if not refresh_token:
return await call_next(request)

with suppress(ExpiredSignatureError):
with suppress(ExpiredSignatureError, InvalidSignatureError):
payload = jwt.decode(
refresh_token,
settings.refresh_token_secret_key,
Expand Down

0 comments on commit ba13357

Please sign in to comment.