mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-11 11:18:40 +08:00
do not break API. add a new function to verify and update password
This commit is contained in:
@@ -16,7 +16,7 @@ from flask.ext.wtf import Form as BaseForm, TextField, PasswordField, \
|
||||
from werkzeug.local import LocalProxy
|
||||
|
||||
from .confirmable import requires_confirmation
|
||||
from .utils import verify_password, get_message
|
||||
from .utils import verify_and_update_password, get_message
|
||||
|
||||
# Convenient reference
|
||||
_datastore = LocalProxy(lambda: current_app.extensions['security'].datastore)
|
||||
@@ -162,7 +162,7 @@ class LoginForm(Form, NextFormMixin):
|
||||
if self.user is None:
|
||||
self.email.errors.append('Specified user does not exist')
|
||||
return False
|
||||
if not verify_password(self.password.data, self.user):
|
||||
if not verify_and_update_password(self.password.data, self.user):
|
||||
self.password.errors.append('Invalid password')
|
||||
return False
|
||||
if requires_confirmation(self.user):
|
||||
|
||||
Reference in New Issue
Block a user