1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

Respect user enabled flag in basic authentication

This commit is contained in:
Stefan Auditor 2018-04-15 14:02:15 +02:00
parent 92f4858323
commit d3064579f4

View File

@ -41,7 +41,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.check_password(password.decode("utf8")):
if user and user.enabled and user.check_password(password.decode("utf8")):
response = flask.Response()
response.headers["X-User"] = user.email
return response