Coverage for seedboxsync/front/forms/login.py: 100%
8 statements
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-26 17:14 +0000
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-26 17:14 +0000
1#
2# Copyright (C) 2015-2026 Guillaume Kulakowski <guillaume@kulakowski.fr>
3#
4# For the full copyright and license information, please view the LICENSE
5# file that was distributed with this source code.
6#
7"""SeedboxSync WTForms form for login."""
9from flask_wtf import FlaskForm
10from wtforms import BooleanField, PasswordField, StringField
11from wtforms.validators import DataRequired, Length
12from seedboxsync.front.babel import gettext as _
15class LoginForm(FlaskForm): # type: ignore[misc]
16 """
17 Form for user login authentication.
19 Provides input fields for username/email and password credentials.
20 """
22 login = StringField(_("Username or email"), validators=[DataRequired(), Length(min=4, max=35)], render_kw={"placeholder": "admin", "icon": "fa-user"})
23 password = PasswordField(_("Password"), validators=[DataRequired(), Length(min=8, max=128)], render_kw={"placeholder": "••••••••••••", "icon": "fa-lock"})
24 remember = BooleanField(_("Remember me"))