From fe0bccc9b388bf2b9a30acda611406dde095202f Mon Sep 17 00:00:00 2001 From: "l.gabrysiak" Date: Sat, 1 Mar 2025 18:32:44 +0100 Subject: [PATCH] mod oauth --- backend/open_webui/main.py | 18 ------------------ backend/open_webui/utils/oauth.py | 3 ++- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 9676d14..f737afd 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -376,24 +376,6 @@ class SPAStaticFiles(StaticFiles): else: raise ex - -print( - rf""" - ██████╗ ██████╗ ███████╗███╗ ██╗ ██╗ ██╗███████╗██████╗ ██╗ ██╗██╗ -██╔═══██╗██╔══██╗██╔════╝████╗ ██║ ██║ ██║██╔════╝██╔══██╗██║ ██║██║ -██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ █╗ ██║█████╗ ██████╔╝██║ ██║██║ -██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║███╗██║██╔══╝ ██╔══██╗██║ ██║██║ -╚██████╔╝██║ ███████╗██║ ╚████║ ╚███╔███╔╝███████╗██████╔╝╚██████╔╝██║ - ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝ - - -v{VERSION} - building the best open-source AI user interface. -{f"Commit: {WEBUI_BUILD_HASH}" if WEBUI_BUILD_HASH != "dev-build" else ""} -https://github.com/open-webui/open-webui -""" -) - - @asynccontextmanager async def lifespan(app: FastAPI): start_logger() diff --git a/backend/open_webui/utils/oauth.py b/backend/open_webui/utils/oauth.py index 2af54c1..2541b5f 100644 --- a/backend/open_webui/utils/oauth.py +++ b/backend/open_webui/utils/oauth.py @@ -366,7 +366,8 @@ class OAuthManager: log.warning("Username claim is missing, using email as name") name = email - role = self.get_user_role(None, user_data) + #role = self.get_user_role(None, user_data) + role = token.get("role", self.get_user_role(None, user_data)) user = Auths.insert_new_auth( email=email,