mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-17 11:19:10 +08:00
Make datastore find_user method accept different params so a user can be retrieved by other such things such as a confirmation token
This commit is contained in:
@@ -337,7 +337,7 @@ class AuthenticationProvider(object):
|
||||
|
||||
return self.do_authenticate(form.email.data, form.password.data)
|
||||
|
||||
def do_authenticate(self, user_identifier, password):
|
||||
def do_authenticate(self, email, password):
|
||||
"""Returns the authenticated user if authentication is successfull. If
|
||||
authentication fails an appropriate error is raised
|
||||
|
||||
@@ -345,7 +345,7 @@ class AuthenticationProvider(object):
|
||||
:param password: The user's unencrypted password
|
||||
"""
|
||||
try:
|
||||
user = current_app.security.datastore.find_user(user_identifier)
|
||||
user = current_app.security.datastore.find_user(email=email)
|
||||
except AttributeError, e:
|
||||
self.auth_error("Could not find user datastore: %s" % e)
|
||||
except exceptions.UserNotFoundError, e:
|
||||
|
||||
Reference in New Issue
Block a user