expephalon-demomodule/core/forms/auth.py
Klaus-Uwe Mitterer d549897186 Too many things to remember all of them
Finally got the mail queue working
Oh yeah, queueing
Added a TOTP provider which doesn't do anything much yet
Probably a hell of a lot of other things that I just can't remember
2020-05-13 12:38:37 +02:00

23 lines
No EOL
708 B
Python

from django.forms import Form, EmailField, CharField, PasswordInput, ChoiceField
from core.helpers.otp import get_otp_choices
class LoginForm(Form):
email = EmailField()
password = CharField(widget=PasswordInput)
class OTPSelectorForm(Form):
def __init__(self, *args, **kwargs):
otp_choices = kwargs.pop('otp_choices', [])
super(OTPSelectorForm, self).__init__(*args, **kwargs)
self.fields['provider'] = ChoiceField(choices=otp_choices)
class OTPVerificationForm(Form):
token = CharField()
class PWResetForm(Form):
password1 = CharField(widget=PasswordInput)
password2 = CharField(widget=PasswordInput)
class PWRequestForm(Form):
email = EmailField()