diff --git a/backend/open_webui/apps/webui/routers/auths.py b/backend/open_webui/apps/webui/routers/auths.py index a077f662a..8569a2fe5 100644 --- a/backend/open_webui/apps/webui/routers/auths.py +++ b/backend/open_webui/apps/webui/routers/auths.py @@ -507,8 +507,8 @@ async def signout(request: Request, response: Response): response.delete_cookie("token") if ENABLE_OAUTH_SIGNUP.value: - id_token = request.cookies.get("id_token") - if id_token: + oauth_id_token = request.cookies.get("oauth_id_token") + if oauth_id_token: try: async with ClientSession() as session: async with session.get(OPENID_PROVIDER_URL.value) as resp: @@ -516,12 +516,14 @@ async def signout(request: Request, response: Response): openid_data = await resp.json() logout_url = openid_data.get("end_session_endpoint") if logout_url: - response.delete_cookie("id_token") - return RedirectResponse(url=f"{logout_url}?id_token_hint={id_token}") + response.delete_cookie("oauth_id_token") + return RedirectResponse( + url=f"{logout_url}?id_token_hint={oauth_id_token}" + ) else: raise HTTPException( status_code=resp.status, - detail="Failed to fetch OpenID configuration" + detail="Failed to fetch OpenID configuration", ) except Exception as e: raise HTTPException(status_code=500, detail=str(e)) diff --git a/backend/open_webui/utils/oauth.py b/backend/open_webui/utils/oauth.py index e7a6b167f..3bab0fc42 100644 --- a/backend/open_webui/utils/oauth.py +++ b/backend/open_webui/utils/oauth.py @@ -252,12 +252,12 @@ class OAuthManager: samesite=WEBUI_SESSION_COOKIE_SAME_SITE, secure=WEBUI_SESSION_COOKIE_SECURE, ) - + if ENABLE_OAUTH_SIGNUP.value: - id_token = token.get("id_token") + oauth_id_token = token.get("id_token") response.set_cookie( - key="id_token", - value=id_token, + key="oauth_id_token", + value=oauth_id_token, httponly=True, samesite=WEBUI_SESSION_COOKIE_SAME_SITE, secure=WEBUI_SESSION_COOKIE_SECURE,