Skip to content

Commit 0926386

Browse files
authored
Fix login problem on Windows (#988)
Get plain text password directly from request. On Windows this is needed because form.vars.get("password", "") returns an hashed password instead of the plain password. On Linux, instead, form.vars.get("password", "") == request.forms.get("password", "")
1 parent fbb321d commit 0926386

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

py4web/utils/auth.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,8 +1673,12 @@ def login(self, model=False):
16731673
return form
16741674

16751675
# If there are no errors, continue with the login process.
1676+
1677+
# Get plain text password directly from request, on Windows this is needed
1678+
# because form.vars.get("password", "") returns an hashed password.
1679+
plain_password = request.forms.get("password", "")
16761680
user, error = self.auth.login(
1677-
form.vars.get("email", ""), form.vars.get("password", "")
1681+
form.vars.get("email", ""), plain_password
16781682
)
16791683
form.accepted = not error
16801684

0 commit comments

Comments
 (0)