add working oauth and ldap client

This commit is contained in:
Jens Langhammer
2018-11-11 13:41:48 +01:00
parent 935155ce94
commit 5aa245cac0
212 changed files with 198506 additions and 0 deletions

View File

View File

@ -0,0 +1,20 @@
"""passbook core authentication forms"""
from django import forms
from django.core.validators import validate_email
from passbook.lib.config import CONFIG
class LoginForm(forms.Form):
"""Allow users to login"""
uid_field = forms.CharField()
password = forms.CharField(widget=forms.PasswordInput())
remember_me = forms.BooleanField(required=False)
def clean_uid_field(self):
"""Validate uid_field after EmailValidator if 'email' is the only selected uid_fields"""
if CONFIG.y('passbook.uid_fields') == ['email']:
validate_email(self.cleaned_data.get('uid_field'))
return self.cleaned_data.get('uid_field')