This commit is contained in:
parent
8c32cfdab3
commit
45ed4f6430
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ def get_token(token=Depends(auth_schema)) -> str:
|
|||
|
||||
async def get_current_user(token: str = Depends(get_token), uow=Depends(UnitOfWork)) -> SUser:
|
||||
try:
|
||||
payload = jwt.decode(token, settings.SECRET_KEY, settings.ALGORITHM)
|
||||
payload = jwt.decode(token, settings.JWT_SECRET_KEY, settings.JWT_ALGORITHM)
|
||||
except ExpiredSignatureError:
|
||||
raise TokenExpiredException
|
||||
except JWTError:
|
||||
|
@ -55,7 +55,7 @@ def get_token_ws(sec_websocket_protocol: Annotated[str | None, Header()] = None)
|
|||
|
||||
async def get_current_user_ws(token: str = Depends(get_token_ws), uow=Depends(UnitOfWork)) -> SUser:
|
||||
try:
|
||||
payload = jwt.decode(token, settings.SECRET_KEY, settings.ALGORITHM)
|
||||
payload = jwt.decode(token, settings.JWT_SECRET_KEY, settings.JWT_ALGORITHM)
|
||||
except ExpiredSignatureError:
|
||||
raise TokenExpiredException
|
||||
except JWTError:
|
||||
|
|
Loading…
Add table
Reference in a new issue