mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-28 12:30:00 +00:00
Merge remote-tracking branch 'auth_token/fix/reverse-proxy-authentication-with-bearer-token'
This commit is contained in:
commit
b152d3e06d
12
cps/web.py
12
cps/web.py
@ -123,12 +123,6 @@ def load_user(user_id):
|
||||
|
||||
@lm.request_loader
|
||||
def load_user_from_request(request):
|
||||
auth_header = request.headers.get("Authorization")
|
||||
if auth_header:
|
||||
user = load_user_from_auth_header(auth_header)
|
||||
if user:
|
||||
return user
|
||||
|
||||
if config.config_allow_reverse_proxy_header_login:
|
||||
rp_header_name = config.config_reverse_proxy_login_header_name
|
||||
if rp_header_name:
|
||||
@ -138,6 +132,12 @@ def load_user_from_request(request):
|
||||
if user:
|
||||
return user
|
||||
|
||||
auth_header = request.headers.get("Authorization")
|
||||
if auth_header:
|
||||
user = load_user_from_auth_header(auth_header)
|
||||
if user:
|
||||
return user
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user