swap_user.otp.forms
CheckOTPForm
¶
Bases: GetOTPForm
Here we are checking User presence among with OPT check.
Source code in swap_user/otp/forms.py
clean()
¶
Method that allows to us pass through few validation checks
- User DB presence
- OTP password validity
Source code in swap_user/otp/forms.py
GetOTPForm
¶
Bases: forms.ModelForm
Unfortunately we can't check User exist or not at this screen by the security reasons - if we will show error when User doesn't exist, attacker can just check all the emails / phones.
Source code in swap_user/otp/forms.py
clean()
¶
We are preventing unique validation by overriding this method and adding extra check for user ban.