Spaces:
Runtime error
Runtime error
Update app/security.py
Browse files- app/security.py +1 -1
app/security.py
CHANGED
|
@@ -24,7 +24,7 @@ def create_access_token(sub: str, expires_in: int = 3600) -> str:
|
|
| 24 |
def parse_token(token: str) -> dict:
|
| 25 |
try:
|
| 26 |
return jwt.decode(token, settings.jwt_secret, algorithms=["HS256"])
|
| 27 |
-
except JWTError
|
| 28 |
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid token")
|
| 29 |
|
| 30 |
def get_current_user(db: Session = Depends(get_db), token: str = Depends(oauth2_scheme)) -> User:
|
|
|
|
| 24 |
def parse_token(token: str) -> dict:
|
| 25 |
try:
|
| 26 |
return jwt.decode(token, settings.jwt_secret, algorithms=["HS256"])
|
| 27 |
+
except JWTError:
|
| 28 |
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid token")
|
| 29 |
|
| 30 |
def get_current_user(db: Session = Depends(get_db), token: str = Depends(oauth2_scheme)) -> User:
|