add 500 code

This commit is contained in:
Saedbhati 2025-10-17 11:28:14 +05:30
parent 40779bf1e5
commit 42fb9c7d16
11 changed files with 30 additions and 30 deletions

View file

@ -32,7 +32,7 @@ def oauth_login(app: str, request: Request, state: Optional[str] = None):
raise
except Exception as e:
logger.error("OAuth login failed", extra={"provider": app, "error": str(e)}, exc_info=True)
raise HTTPException(status_code=400, detail=str(e))
raise HTTPException(status_code=400, detail="OAuth login failed")
@router.get("/{app}/callback", name="OAuth Callback")
@ -78,4 +78,4 @@ def fetch_token(app: str, request: Request, data: OauthCallbackPayload):
return JSONResponse(token_data)
except Exception as e:
logger.error("OAuth token fetch failed", extra={"provider": app, "error": str(e)}, exc_info=True)
raise HTTPException(status_code=500, detail=str(e))
raise HTTPException(status_code=500, detail="Internal server error")