main #3

Merged
tdpeuter merged 116 commits from open-webui/open-webui:main into main 2024-03-26 12:22:23 +01:00
Showing only changes of commit 8e52ba8b91 - Show all commits

View file

@ -47,13 +47,12 @@ async def auth_middleware(request: Request, call_next):
auth_header = request.headers.get("Authorization", "") auth_header = request.headers.get("Authorization", "")
request.state.user = None request.state.user = None
if ENV != "dev": try:
try: user = get_current_user(get_http_authorization_cred(auth_header))
user = get_current_user(get_http_authorization_cred(auth_header)) print(user)
print(user) request.state.user = user
request.state.user = user except Exception as e:
except Exception as e: return JSONResponse(status_code=400, content={"detail": str(e)})
return JSONResponse(status_code=400, content={"detail": str(e)})
response = await call_next(request) response = await call_next(request)
return response return response