mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
Environment variable to redirect on logout
This commit is contained in:
@@ -27,6 +27,7 @@ from open_webui.env import (
|
||||
WEBUI_AUTH_TRUSTED_NAME_HEADER,
|
||||
WEBUI_AUTH_COOKIE_SAME_SITE,
|
||||
WEBUI_AUTH_COOKIE_SECURE,
|
||||
SIGNOUT_REDIRECT_URI,
|
||||
SRC_LOG_LEVELS,
|
||||
)
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request, status
|
||||
@@ -555,6 +556,12 @@ async def signout(request: Request, response: Response):
|
||||
detail="Failed to sign out from the OpenID provider.",
|
||||
)
|
||||
|
||||
if SIGNOUT_REDIRECT_URI:
|
||||
return RedirectResponse(
|
||||
headers=response.headers,
|
||||
url=SIGNOUT_REDIRECT_URI,
|
||||
)
|
||||
|
||||
return {"status": True}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user