diff --git a/secureauth/defaults.py b/secureauth/defaults.py index 726257d..50ebd94 100644 --- a/secureauth/defaults.py +++ b/secureauth/defaults.py @@ -80,3 +80,4 @@ def _(message): ]) AUTH_USER_MODEL = get_settings('AUTH_USER_MODEL', 'auth.User') +INPUT_TYPE = get_settings('AUTH_INPUT_TYPE', 'password') diff --git a/secureauth/forms.py b/secureauth/forms.py index 8c358a0..83db9ef 100644 --- a/secureauth/forms.py +++ b/secureauth/forms.py @@ -8,7 +8,7 @@ from models import ( UserAuthNotification, UserAuthLogging, UserAuthToken, UserAuthAttempt, UserAuthCode, UserAuthPhone, UserAuthQuestion, UserAuthIP, UserAuthIPRange) -from defaults import CHECK_PASSWORD +from defaults import CHECK_PASSWORD, INPUT_TYPE from utils.sign import Sign from utils import is_phone @@ -59,7 +59,11 @@ def save(self): class CodeForm(forms.Form): - code = forms.CharField(label=_('Code'), required=True) + code = forms.CharField( + label=_('Code'), required=True, + widget=forms.TextInput(attrs={ + 'autocomplete': 'off', 'type': INPUT_TYPE + })) def __init__(self, user, model, *args, **kwargs): self.user = user