mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Add endpoints for forgot-password.
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from flask_wtf import Form
|
||||
from wtforms import StringField, PasswordField, ValidationError
|
||||
from wtforms.validators import DataRequired, Email, Length, Regexp
|
||||
from app.main.dao import verify_codes_dao
|
||||
from app.main.encryption import check_hash
|
||||
from app.main.validators import Blacklist, ValidateUserCodes
|
||||
|
||||
|
||||
@@ -123,3 +120,14 @@ class AddServiceForm(Form):
|
||||
def validate_service_name(self, a):
|
||||
if self.service_name.data in self.service_names:
|
||||
raise ValidationError('Service name already exists')
|
||||
|
||||
|
||||
class ForgotPassword(Form):
|
||||
email_address = StringField('Email address',
|
||||
validators=[Length(min=5, max=255),
|
||||
DataRequired(message='Email cannot be empty'),
|
||||
Email(message='Please enter a valid email address'),
|
||||
Regexp(regex=gov_uk_email, message='Please enter a gov.uk email address')
|
||||
])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user