Add in auth however there are no restrictions currently
This commit is contained in:
34
forms/signup.py
Normal file
34
forms/signup.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, PasswordField, SubmitField
|
||||
from wtforms.validators import DataRequired, Length, EqualTo, Email
|
||||
|
||||
class SignupForm(FlaskForm):
|
||||
name = StringField(
|
||||
'Name',
|
||||
validators=[
|
||||
DataRequired(),
|
||||
Length(min=2, max=100, message="Name must be between 2 and 100 characters.")
|
||||
]
|
||||
)
|
||||
email = StringField(
|
||||
'Email',
|
||||
validators=[
|
||||
DataRequired(),
|
||||
Email(message="Enter a valid email address.")
|
||||
]
|
||||
)
|
||||
password = PasswordField(
|
||||
'Password',
|
||||
validators=[
|
||||
DataRequired(),
|
||||
Length(min=6, message="Password must be at least 6 characters long.")
|
||||
]
|
||||
)
|
||||
confirm_password = PasswordField(
|
||||
'Confirm Password',
|
||||
validators=[
|
||||
DataRequired(),
|
||||
EqualTo('password', message="Passwords must match.")
|
||||
]
|
||||
)
|
||||
submit = SubmitField('Sign Up')
|
||||
Reference in New Issue
Block a user