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:
parent
92f4858323
commit
d3064579f4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user