2021-09-02 13:36:42 +02:00
|
|
|
from wtforms import validators, fields, widgets
|
|
|
|
from wtforms_components import fields as fields_
|
|
|
|
from flask_babel import lazy_gettext as _
|
|
|
|
|
|
|
|
import flask_login
|
|
|
|
import flask_wtf
|
|
|
|
import re
|
|
|
|
|
2021-09-02 17:08:50 +02:00
|
|
|
LOCALPART_REGEX = "^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*$"
|
|
|
|
|
2021-09-02 13:36:42 +02:00
|
|
|
class LoginForm(flask_wtf.FlaskForm):
|
|
|
|
class Meta:
|
|
|
|
csrf = False
|
2021-09-24 15:29:28 +02:00
|
|
|
target = fields.SelectField( _('Go to') )
|
2021-09-02 13:36:42 +02:00
|
|
|
email = fields.StringField(_('E-mail'), [validators.Email()])
|
|
|
|
pw = fields.PasswordField(_('Password'), [validators.DataRequired()])
|
|
|
|
submit = fields.SubmitField(_('Sign in'))
|
2021-09-24 10:07:52 +02:00
|
|
|
|