|
|
@ -94,11 +94,11 @@ def handle_authentication(headers):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
user = models.User.query.get(user_email) if '@' in user_email else None
|
|
|
|
user = models.User.query.get(user_email) if '@' in user_email else None
|
|
|
|
is_valid_user = user is not None
|
|
|
|
|
|
|
|
except sqlalchemy.exc.StatementError as exc:
|
|
|
|
except sqlalchemy.exc.StatementError as exc:
|
|
|
|
exc = str(exc).split('\n', 1)[0]
|
|
|
|
exc = str(exc).split('\n', 1)[0]
|
|
|
|
app.logger.warn(f'Invalid user {user_email!r}: {exc}')
|
|
|
|
app.logger.warn(f'Invalid user {user_email!r}: {exc}')
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
|
|
|
|
is_valid_user = user is not None
|
|
|
|
ip = urllib.parse.unquote(headers["Client-Ip"])
|
|
|
|
ip = urllib.parse.unquote(headers["Client-Ip"])
|
|
|
|
if check_credentials(user, password, ip, protocol, headers["Auth-Port"]):
|
|
|
|
if check_credentials(user, password, ip, protocol, headers["Auth-Port"]):
|
|
|
|
server, port = get_server(headers["Auth-Protocol"], True)
|
|
|
|
server, port = get_server(headers["Auth-Protocol"], True)
|
|
|
|