From: Adam Dullage Date: Sun, 27 Feb 2022 11:13:56 +0000 (+0000) Subject: Fix Blank Exception X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d8ca815896bc1c34d412b5b0ec6345100e18db43;p=flatnotes.git Fix Blank Exception --- diff --git a/flatnotes/auth.py b/flatnotes/auth.py index bc01357..23cece7 100644 --- a/flatnotes/auth.py +++ b/flatnotes/auth.py @@ -32,7 +32,7 @@ async def validate_token(token: str = Depends(oauth2_scheme)): if username is None or username.lower() != FLATNOTES_USERNAME.lower(): raise ValueError return FLATNOTES_USERNAME - except: + except (JWTError, ValueError): raise HTTPException( status_code=401, detail="Invalid authentication credentials",