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
e15dbdc4
Commit
e15dbdc4
authored
Feb 01, 2024
by
Tim Farrell
Browse files
Pass the instance we're using.
parent
8c37edd0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
backend/utils/utils.py
backend/utils/utils.py
+2
-2
No files found.
backend/utils/utils.py
View file @
e15dbdc4
...
...
@@ -21,7 +21,7 @@ ALGORITHM = "HS256"
# Auth Utils
##############
bearer_s
cheme
=
HTTPBearer
()
bearer_s
ecurity
=
HTTPBearer
()
pwd_context
=
CryptContext
(
schemes
=
[
"bcrypt"
],
deprecated
=
"auto"
)
...
...
@@ -58,7 +58,7 @@ def extract_token_from_auth_header(auth_header: str):
return
auth_header
[
len
(
"Bearer "
)
:]
def
get_current_user
(
auth_token
:
HTTPAuthorizationCredentials
=
Depends
(
HTTPBearer
()
)):
def
get_current_user
(
auth_token
:
HTTPAuthorizationCredentials
=
Depends
(
bearer_security
)):
data
=
decode_token
(
auth_token
.
credentials
)
if
data
!=
None
and
"id"
in
data
:
user
=
Users
.
get_user_by_id
(
data
[
"id"
])
...
...
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