mirror of
https://github.com/wizarrrr/wizarr.git
synced 2026-06-11 23:34:47 -04:00
Also changed admin account signup to have the same password requirements as jellyfin account signup (since presumably wizarr is somewhat public, it should have a good password as well).
28 lines
937 B
Python
28 lines
937 B
Python
from flask_wtf import FlaskForm
|
|
from wtforms import StringField, PasswordField
|
|
from wtforms.validators import DataRequired, Length, EqualTo, Regexp
|
|
|
|
class AdminAccountForm(FlaskForm):
|
|
username = StringField(
|
|
"Username",
|
|
validators=[
|
|
DataRequired(),
|
|
Length(min=3, max=15, message="Username must be 3 to 15 characters."),
|
|
],
|
|
)
|
|
password = PasswordField(
|
|
"Password",
|
|
validators=[
|
|
DataRequired(),
|
|
Length(min=8, message="Password must be at least 8 characters."),
|
|
Regexp(
|
|
r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).+$',
|
|
message="Password must contain at least one uppercase letter, one lowercase letter, and one number.",
|
|
),
|
|
],
|
|
)
|
|
confirm = PasswordField(
|
|
"Confirm password",
|
|
validators=[DataRequired(), EqualTo("password", message="Passwords must match.")],
|
|
)
|