mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
complete updating the endpoints and models
This commit is contained in:
@@ -105,15 +105,14 @@ async def token(form_data: Annotated[OAuth2RequestForm, Depends()]) -> TokenResp
|
||||
status_code=status.HTTP_400_BAD_REQUEST, detail="Missing refresh token"
|
||||
)
|
||||
|
||||
potential_user = await oauth_handler.get_current_active_user_from_bearer_token(
|
||||
user, claims = await oauth_handler.get_current_active_user_from_bearer_token(
|
||||
token
|
||||
)
|
||||
if not potential_user:
|
||||
if not user or not claims:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid refresh token"
|
||||
)
|
||||
|
||||
user, claims = potential_user
|
||||
if claims.get("type") != "refresh":
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid refresh token"
|
||||
|
||||
Reference in New Issue
Block a user