Unescape passwords before cecking

master
kaiyou 7 years ago
parent 0a74213eae
commit ec6d5acc18

@ -1,6 +1,7 @@
from mailu import db, models from mailu import db, models
import socket import socket
import urllib
SUPPORTED_AUTH_METHODS = ["none", "plain"] SUPPORTED_AUTH_METHODS = ["none", "plain"]
@ -36,8 +37,8 @@ def handle_authentication(headers):
} }
# Authenticated user # Authenticated user
elif method == "plain": elif method == "plain":
user_email = headers["Auth-User"] user_email = urllib.parse.unquote(headers["Auth-User"])
password = headers["Auth-Pass"] password = urllib.parse.unquote(headers["Auth-Pass"])
user = models.User.query.get(user_email) user = models.User.query.get(user_email)
if user and user.check_password(password): if user and user.check_password(password):
return { return {

Loading…
Cancel
Save