diff --git a/src/authentic2/forms/widgets.py b/src/authentic2/forms/widgets.py index 297bfe20e..9ec35723a 100644 --- a/src/authentic2/forms/widgets.py +++ b/src/authentic2/forms/widgets.py @@ -238,6 +238,9 @@ class PasswordInput(BasePasswordInput): class NewPasswordInput(PasswordInput): def render(self, name, value, attrs=None): + if attrs is None: + attrs = {} + attrs['autocomplete'] = 'new-password' output = super(NewPasswordInput, self).render(name, value, attrs=attrs) if attrs: _id = attrs.get('id') @@ -250,6 +253,9 @@ class CheckPasswordInput(PasswordInput): # this widget must be named xxx2 and the other widget xxx1, it's a # convention, js code expect it. def render(self, name, value, attrs=None): + if attrs is None: + attrs = {} + attrs['autocomplete'] = 'new-password' output = super(CheckPasswordInput, self).render(name, value, attrs=attrs) if attrs: _id = attrs.get('id')