1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-07-15 01:24:34 +02:00

Merge remote-tracking branch 'upstream/master' into webmail-sso

This commit is contained in:
Florent Daigniere
2021-03-10 14:41:12 +01:00
50 changed files with 946 additions and 181 deletions

View File

@ -65,7 +65,7 @@ def basic_authentication():
encoded = authorization.replace("Basic ", "")
user_email, password = base64.b64decode(encoded).split(b":")
user = models.User.query.get(user_email.decode("utf8"))
if user and user.enabled and user.check_password(password.decode("utf8")):
if nginx.check_credentials(user, password.decode('utf-8'), flask.request.remote_addr, "web"):
response = flask.Response()
response.headers["X-User"] = user.email
return response