mirror of
https://github.com/zebrajr/ollama-webui.git
synced 2026-01-15 12:15:13 +00:00
chore: format
This commit is contained in:
@@ -91,7 +91,6 @@ if SQLALCHEMY_DATABASE_URL.startswith("sqlite+sqlcipher://"):
|
||||
# Extract database path from SQLCipher URL
|
||||
db_path = SQLALCHEMY_DATABASE_URL.replace("sqlite+sqlcipher://", "")
|
||||
|
||||
|
||||
# Create a custom creator function that uses sqlcipher3
|
||||
def create_sqlcipher_connection():
|
||||
import sqlcipher3
|
||||
|
||||
@@ -55,7 +55,6 @@ def register_connection(db_url):
|
||||
# Convert sqlite+sqlcipher:///path/to/db.sqlite to /path/to/db.sqlite
|
||||
db_path = db_url.replace("sqlite+sqlcipher://", "")
|
||||
|
||||
|
||||
# Use Peewee's native SqlCipherDatabase with encryption
|
||||
db = SqlCipherDatabase(db_path, passphrase=database_password)
|
||||
db.autoconnect = True
|
||||
|
||||
@@ -47,7 +47,7 @@ from open_webui.utils.access_control import has_access, get_users_with_access
|
||||
|
||||
from open_webui.env import (
|
||||
GLOBAL_LOG_LEVEL,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
logging.basicConfig(stream=sys.stdout, level=GLOBAL_LOG_LEVEL)
|
||||
|
||||
@@ -795,15 +795,17 @@ class OAuthClientManager:
|
||||
# Passing them again causes Authlib to concatenate them (e.g., "ID1,ID1"),
|
||||
# which results in 401 errors from the token endpoint. (Fix for #19823)
|
||||
token = await client.authorize_access_token(request)
|
||||
|
||||
|
||||
# Validate that we received a proper token response
|
||||
# If token exchange failed (e.g., 401), we may get an error response instead
|
||||
if token and not token.get("access_token"):
|
||||
error_desc = token.get("error_description", token.get("error", "Unknown error"))
|
||||
error_desc = token.get(
|
||||
"error_description", token.get("error", "Unknown error")
|
||||
)
|
||||
error_message = f"Token exchange failed: {error_desc}"
|
||||
log.error(f"Invalid token response for client_id {client_id}: {token}")
|
||||
token = None
|
||||
|
||||
|
||||
if token:
|
||||
try:
|
||||
# Add timestamp for tracking
|
||||
|
||||
Reference in New Issue
Block a user