добавили responce_model=User к get_current_user
This commit is contained in:
parent
6127dd8ba4
commit
d5ba710885
@ -76,7 +76,7 @@ async def get_current_user(db: SessionLocal, token: Annotated[str, Depends(oauth
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
try:
|
||||
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM])
|
||||
payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM], response_model=User)
|
||||
email: str = payload.get("sub")
|
||||
if email is None:
|
||||
raise credentials_exception
|
||||
|
Loading…
x
Reference in New Issue
Block a user