🐛 Fix login via Authorization header

This commit is contained in:
Gina Häußge committed 2019-03-25 11:31:41 +01:00
1 parent 1d2ceefb72
commit 547962f4bc
1 file changed
+5 -1
+5 -1
View File
@@ -50,7 +50,11 @@ def loginFromAuthorizationHeaderRequestHandler():
"""
``before_request`` handler for creating login sessions based on the Authorization header.
"""
loginUserFromApiKey()
try:
if loginUserFromAuthorizationHeader():
_flask.g.login_via_header = True
except InvalidApiKeyException:
return _flask.make_response("Invalid API key", 403)
class InvalidApiKeyException(Exception): pass