Add check to force users to change password (#2284)

This commit is contained in:
ser8phin
2021-11-11 11:10:33 +01:00
committed by GitHub
parent 245ad644ff
commit 169a6c51b4
11 changed files with 137 additions and 10 deletions

View File

@@ -429,6 +429,15 @@
</div>
{% endif %}
{% if request.user.needs_password_change %}
<div class="alert alert-warning">
{% blocktrans trimmed %}
For security reasons, please change your password before you continue. Afterwards you
will be redirected to your original destination.
{% endblocktrans %}
</div>
{% endif %}
{% block content %}
{% endblock %}
<footer>

View File

@@ -19,6 +19,7 @@
{% bootstrap_field form.email layout='control' %}
{% bootstrap_field form.new_pw layout='control' %}
{% bootstrap_field form.new_pw_repeat layout='control' %}
{% bootstrap_field form.needs_password_change layout='control' %}
</fieldset>
<div class="form-group submit-group">
<button type="submit" class="btn btn-primary btn-save">

View File

@@ -45,6 +45,7 @@
{% endif %}
{% bootstrap_field form.last_login layout='control' %}
{% bootstrap_field form.require_2fa layout='control' %}
{% bootstrap_field form.needs_password_change layout='control' %}
</fieldset>
<fieldset>
<legend>{% trans "Team memberships" %}</legend>