mirror of
https://github.com/wassname/flask-security.git
synced 2026-09-09 11:22:35 +08:00
Polish up some code and add some signals
This commit is contained in:
@@ -302,6 +302,9 @@ class ForgotPasswordForm(Form):
|
||||
email = TextField("Email Address",
|
||||
validators=[Required(message="Email not provided")])
|
||||
|
||||
def to_dict(self):
|
||||
return dict(email=self.email.data)
|
||||
|
||||
|
||||
class LoginForm(Form):
|
||||
"""The default login form"""
|
||||
@@ -334,13 +337,18 @@ class RegisterForm(Form):
|
||||
|
||||
|
||||
class ResetPasswordForm(Form):
|
||||
reset_password_token = HiddenField(validators=[Required()])
|
||||
token = HiddenField(validators=[Required()])
|
||||
email = HiddenField(validators=[Required()])
|
||||
password = PasswordField("Password",
|
||||
validators=[Required(message="Password not provided")])
|
||||
password_confirm = PasswordField("Retype Password",
|
||||
validators=[EqualTo('password', message="Passwords do not match")])
|
||||
|
||||
def to_dict(self):
|
||||
return dict(token=self.token.data,
|
||||
email=self.email.data,
|
||||
password=self.password.data)
|
||||
|
||||
|
||||
class AuthenticationProvider(object):
|
||||
"""The default authentication provider implementation.
|
||||
|
||||
Reference in New Issue
Block a user