Spaces:
Running
Running
Update admin_routes.py
Browse files- admin_routes.py +1 -1
admin_routes.py
CHANGED
@@ -183,7 +183,7 @@ def verify_token(credentials: HTTPAuthorizationCredentials = Depends(security))
|
|
183 |
return username
|
184 |
except jwt.ExpiredSignatureError:
|
185 |
raise HTTPException(status_code=401, detail="Token expired")
|
186 |
-
except jwt.
|
187 |
raise HTTPException(status_code=401, detail="Invalid token")
|
188 |
|
189 |
def hash_password(password: str, salt: str = None) -> tuple[str, str]:
|
|
|
183 |
return username
|
184 |
except jwt.ExpiredSignatureError:
|
185 |
raise HTTPException(status_code=401, detail="Token expired")
|
186 |
+
except jwt.InvalidTokenError: # Bu genel JWT hatalarını yakalar
|
187 |
raise HTTPException(status_code=401, detail="Invalid token")
|
188 |
|
189 |
def hash_password(password: str, salt: str = None) -> tuple[str, str]:
|