Files
wizarr/app/forms/setup.py
fireph 195dde2e49 Change password to not have limit
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).
2025-06-09 02:42:37 -07:00

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.")],
)