Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
b11af9ea
Commit
b11af9ea
authored
Apr 02, 2024
by
Timothy J. Baek
Browse files
fix
parent
56369fea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
backend/apps/web/models/auths.py
backend/apps/web/models/auths.py
+6
-0
No files found.
backend/apps/web/models/auths.py
View file @
b11af9ea
...
...
@@ -48,9 +48,11 @@ class Token(BaseModel):
token
:
str
token_type
:
str
class
ApiKey
(
BaseModel
):
api_key
:
Optional
[
str
]
=
None
class
UserResponse
(
BaseModel
):
id
:
str
email
:
str
...
...
@@ -132,6 +134,7 @@ class AuthsTable:
# if no api_key, return None
if
not
api_key
:
return
None
try
:
auth
=
Auth
.
get
(
Auth
.
api_key
==
api_key
,
Auth
.
active
==
True
)
if
auth
:
...
...
@@ -140,6 +143,9 @@ class AuthsTable:
else
:
return
None
except
:
return
False
def
authenticate_user_by_trusted_header
(
self
,
email
:
str
)
->
Optional
[
UserModel
]:
log
.
info
(
f
"authenticate_user_by_trusted_header:
{
email
}
"
)
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment