2020-04-15 20:19:03 +00:00
|
|
|
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):
|
2020-04-18 13:02:41 +00:00
|
|
|
token = CharField()
|
|
|
|
|
|
|
|
class PWResetForm(Form):
|
|
|
|
password1 = CharField(widget=PasswordInput)
|
2020-05-13 10:38:37 +00:00
|
|
|
password2 = CharField(widget=PasswordInput)
|
|
|
|
|
|
|
|
class PWRequestForm(Form):
|
|
|
|
email = EmailField()
|