Fix Blank Exception
authorAdam Dullage <redacted>
Sun, 27 Feb 2022 11:13:56 +0000 (11:13 +0000)
committerAdam Dullage <redacted>
Sun, 27 Feb 2022 11:13:56 +0000 (11:13 +0000)
flatnotes/auth.py

index bc0135774d2ed24a694380db54c680a19b1ffc88..23cece723cd3ba0cd085048e19349f380ec5ab58 100644 (file)
@@ -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",
git clone https://git.99rst.org/PROJECT