diff --git a/.djlintrc b/.djlintrc
new file mode 100644
index 00000000..79a88ccd
--- /dev/null
+++ b/.djlintrc
@@ -0,0 +1,11 @@
+{
+ "ignore": "H017,H025,H030,H031",
+ "extension": "html",
+ "indent": "2",
+ "profile": "jinja",
+ "format_attribute_template_tags": "true",
+ "max_line_length": 120,
+ "max_attribute_length": 240,
+ "blank_line_after_tag": "from,endmacro",
+ "blank_line_before_tag": "block,extends"
+}
diff --git a/flask_security/templates/security/_macros.html b/flask_security/templates/security/_macros.html
index d01f2654..1f4fae48 100644
--- a/flask_security/templates/security/_macros.html
+++ b/flask_security/templates/security/_macros.html
@@ -3,9 +3,7 @@
{{ field.label }} {{ field(**kwargs)|safe }}
{% if field.errors %}
{{ _fsdomain("You can log into your account using the following code:") }} {{ token }}
diff --git a/flask_security/templates/security/email/two_factor_rescue.html b/flask_security/templates/security/email/two_factor_rescue.html
index 4859e660..e51523c1 100644
--- a/flask_security/templates/security/email/two_factor_rescue.html
+++ b/flask_security/templates/security/email/two_factor_rescue.html
@@ -1 +1 @@
-{{ _fsdomain("You can sign into your account using the following code:") }} {{ token }}
-
{% if login_link %}
{{ _fsdomain('Someone (you?) tried to register this email - which is already in our system.') }}
-
{% if user.username %}
-{{ _fsdomain('This account also has the following username associated with it: %(username)s.', username=user.username) }}
+
+ {{ _fsdomain('This account also has the following username associated with it: %(username)s.', username=user.username) }}
+
{% endif %}
-
{% if recovery_link %}
- {{ _fsdomain('If you forgot your password you can reset it') }}
-
{{ _fsdomain(' here.') }}
+
{% endif %}
diff --git a/flask_security/templates/security/email/welcome_existing_username.html b/flask_security/templates/security/email/welcome_existing_username.html
index 82126f86..e7b88211 100644
--- a/flask_security/templates/security/email/welcome_existing_username.html
+++ b/flask_security/templates/security/email/welcome_existing_username.html
@@ -9,8 +9,7 @@
for username enumeration.
#}
{{ _fsdomain('Hello %(email)s!', email=email) }}
-
-
{{ _fsdomain('You attempted to register with a username "%(username)s" that is already associated with another account.',
- username=username) }}
-
+
+ {{ _fsdomain('You attempted to register with a username "%(username)s" that is already associated with another account.', username=username) }}
+
{{ _fsdomain('Please restart the registration process with a different username.') }}
diff --git a/flask_security/templates/security/forgot_password.html b/flask_security/templates/security/forgot_password.html
index 8e897086..1b07a09d 100644
--- a/flask_security/templates/security/forgot_password.html
+++ b/flask_security/templates/security/forgot_password.html
@@ -2,12 +2,12 @@
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
-{% include "security/_messages.html" %}
-
{{ _fsdomain('Send password reset instructions') }}
-
-{% include "security/_menu.html" %}
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain('Send password reset instructions') }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/login_user.html b/flask_security/templates/security/login_user.html
index d1bc297b..0991a68b 100644
--- a/flask_security/templates/security/login_user.html
+++ b/flask_security/templates/security/login_user.html
@@ -2,22 +2,17 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_errors, render_form_errors, prop_next %}
{% block content %}
-{% include "security/_messages.html" %}
-
{{ _fsdomain('Login') }}
-
- {{ mf_recovery_form.hidden_tag() }}
- {{ render_field_with_errors(mf_recovery_form.code) }}
- {{ render_field(mf_recovery_form.submit) }}
-
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain("Enter Recovery Code") }}
+
+ {{ mf_recovery_form.hidden_tag() }}
+ {{ render_field_with_errors(mf_recovery_form.code) }}
+ {{ render_field(mf_recovery_form.submit) }}
+
+{% endblock content %}
diff --git a/flask_security/templates/security/mf_recovery_codes.html b/flask_security/templates/security/mf_recovery_codes.html
index 988c0c32..38853ad7 100644
--- a/flask_security/templates/security/mf_recovery_codes.html
+++ b/flask_security/templates/security/mf_recovery_codes.html
@@ -2,31 +2,26 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_errors %}
{% block content %}
- {% include "security/_messages.html" %}
-
{{ _fsdomain("Recovery Codes") }}
- {% if recovery_codes %}
-
- {% for rc in recovery_codes %}
- {{ rc }}
- {% endfor %}
-
-
+ {% include "security/_messages.html" %}
+
{{ _fsdomain("Recovery Codes") }}
+ {% if recovery_codes %}
+
+ {% for rc in recovery_codes %}{{ rc }} {% endfor %}
+
+
{{ _fsdomain("Be sure to copy these and store in a safe place. Each code can be used only once.") }}
-
- {% else %}
-
-
- {{ render_field_with_errors(mf_recovery_codes_form.show_codes) }}
-
- {% endif %}
-
-
{{ _fsdomain("Generate new Recovery Codes") }}
-
- {{ mf_recovery_codes_form.hidden_tag() }}
- {{ render_field_errors(mf_recovery_codes_form.csrf_token) }}
- {{ render_field(mf_recovery_codes_form.generate_new_codes) }}
+
+ {% else %}
+
+ {{ render_field_with_errors(mf_recovery_codes_form.show_codes) }}
- {% include "security/_menu.html" %}
-{% endblock %}
+ {% endif %}
+
+
{{ _fsdomain("Generate new Recovery Codes") }}
+
+ {{ mf_recovery_codes_form.hidden_tag() }}
+ {{ render_field_errors(mf_recovery_codes_form.csrf_token) }}
+ {{ render_field(mf_recovery_codes_form.generate_new_codes) }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/register_user.html b/flask_security/templates/security/register_user.html
index 1650b3a3..6bee960b 100644
--- a/flask_security/templates/security/register_user.html
+++ b/flask_security/templates/security/register_user.html
@@ -2,20 +2,18 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, render_form_errors %}
{% block content %}
-{% include "security/_messages.html" %}
-
{{ _fsdomain('Register') }}
-
- {{ register_user_form.hidden_tag() }}
- {{ render_form_errors(register_user_form) }}
- {{ render_field_with_errors(register_user_form.email) }}
- {% if security.username_enable %}
- {{ render_field_with_errors(register_user_form.username) }}
- {% endif %}
- {{ render_field_with_errors(register_user_form.password) }}
- {% if register_user_form.password_confirm %}
- {{ render_field_with_errors(register_user_form.password_confirm) }}
- {% endif %}
- {{ render_field(register_user_form.submit) }}
-
-{% include "security/_menu.html" %}
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain('Register') }}
+
+ {{ register_user_form.hidden_tag() }}
+ {{ render_form_errors(register_user_form) }}
+ {{ render_field_with_errors(register_user_form.email) }}
+ {% if security.username_enable %}{{ render_field_with_errors(register_user_form.username) }}{% endif %}
+ {{ render_field_with_errors(register_user_form.password) }}
+ {% if register_user_form.password_confirm %}
+ {{ render_field_with_errors(register_user_form.password_confirm) }}
+ {% endif %}
+ {{ render_field(register_user_form.submit) }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/reset_password.html b/flask_security/templates/security/reset_password.html
index ab074d1a..1a9b593e 100644
--- a/flask_security/templates/security/reset_password.html
+++ b/flask_security/templates/security/reset_password.html
@@ -2,13 +2,13 @@
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
-{% include "security/_messages.html" %}
-
{{ _fsdomain('Reset password') }}
-
- {{ reset_password_form.hidden_tag() }}
- {{ render_field_with_errors(reset_password_form.password) }}
- {{ render_field_with_errors(reset_password_form.password_confirm) }}
- {{ render_field(reset_password_form.submit) }}
-
-{% include "security/_menu.html" %}
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain('Reset password') }}
+
+ {{ reset_password_form.hidden_tag() }}
+ {{ render_field_with_errors(reset_password_form.password) }}
+ {{ render_field_with_errors(reset_password_form.password_confirm) }}
+ {{ render_field(reset_password_form.submit) }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/send_confirmation.html b/flask_security/templates/security/send_confirmation.html
index 3ee1de1d..82e88e41 100644
--- a/flask_security/templates/security/send_confirmation.html
+++ b/flask_security/templates/security/send_confirmation.html
@@ -2,12 +2,12 @@
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
-{% include "security/_messages.html" %}
-
{{ _fsdomain('Resend confirmation instructions') }}
-
- {{ send_confirmation_form.hidden_tag() }}
- {{ render_field_with_errors(send_confirmation_form.email) }}
- {{ render_field(send_confirmation_form.submit) }}
-
-{% include "security/_menu.html" %}
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain('Resend confirmation instructions') }}
+
+ {{ send_confirmation_form.hidden_tag() }}
+ {{ render_field_with_errors(send_confirmation_form.email) }}
+ {{ render_field(send_confirmation_form.submit) }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/send_login.html b/flask_security/templates/security/send_login.html
index 4e5a25d1..bafccb38 100644
--- a/flask_security/templates/security/send_login.html
+++ b/flask_security/templates/security/send_login.html
@@ -2,12 +2,12 @@
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
-{% include "security/_messages.html" %}
-
{{ _fsdomain('Login') }}
-
- {{ send_login_form.hidden_tag() }}
- {{ render_field_with_errors(send_login_form.email) }}
- {{ render_field(send_login_form.submit) }}
-
-{% include "security/_menu.html" %}
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain('Login') }}
+
+ {{ send_login_form.hidden_tag() }}
+ {{ render_field_with_errors(send_login_form.email) }}
+ {{ render_field(send_login_form.submit) }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/two_factor_select.html b/flask_security/templates/security/two_factor_select.html
index fbb72c91..44d620fc 100644
--- a/flask_security/templates/security/two_factor_select.html
+++ b/flask_security/templates/security/two_factor_select.html
@@ -2,12 +2,12 @@
{% from "security/_macros.html" import prop_next, render_field_with_errors, render_field %}
{% block content %}
-{% include "security/_messages.html" %}
-
{{ _fsdomain('Select Two Factor Method') }}
-
- {{ two_factor_select_form.hidden_tag() }}
- {{ render_field_with_errors(two_factor_select_form.which) }}
- {{ render_field(two_factor_select_form.submit) }}
-
-{% include "security/_menu.html" %}
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain('Select Two Factor Method') }}
+
+ {{ two_factor_select_form.hidden_tag() }}
+ {{ render_field_with_errors(two_factor_select_form.which) }}
+ {{ render_field(two_factor_select_form.submit) }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/two_factor_setup.html b/flask_security/templates/security/two_factor_setup.html
index 8a377c54..d7055a3d 100644
--- a/flask_security/templates/security/two_factor_setup.html
+++ b/flask_security/templates/security/two_factor_setup.html
@@ -20,67 +20,63 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_no_label, render_field_errors %}
{% block content %}
- {% include "security/_messages.html" %}
-
{{ _fsdomain("Two-factor authentication adds an extra layer of security to your account") }}
-
{{ _fsdomain("In addition to your username and password, you'll need to use a code.") }}
-
- {{ two_factor_setup_form.hidden_tag() }}
- {{ _fsdomain("Currently setup two-factor method: %(method)s", method=primary_method) }}
-
- {% for subfield in two_factor_setup_form.setup %}
- {% if subfield.data in choices %}
- {{ render_field_with_errors(subfield) }}
- {% endif %}
- {% endfor %}
- {{ render_field_errors(two_factor_setup_form.setup) }}
- {{ render_field(two_factor_setup_form.submit) }}
- {% if chosen_method=="email" and chosen_method in choices %}
- {{ _fsdomain("To complete logging in, please enter the code sent to your mail") }}
- {% endif %}
- {% if chosen_method=="authenticator" and chosen_method in choices %}
-
-
-
- {{ _fsdomain("Open an authenticator app on your device and scan the following QRcode (or enter the code below manually) to start receiving codes:") }}
-
-
-
-
-
- {{ authr_key }}
-
-
- {% endif %}
- {% if chosen_method=="sms" and chosen_method in choices %}
- {{ _fsdomain("To Which Phone Number Should We Send Code To?") }}
- {{ two_factor_setup_form.hidden_tag() }}
- {{ render_field_with_errors(two_factor_setup_form.phone) }}
- {{ render_field(two_factor_setup_form.submit) }}
- {% endif %}
-
- {% if security.webauthn and not chosen_method %}
-
{{ _fsdomain("WebAuthn") }}
-
+ {% include "security/_messages.html" %}
+
{{ _fsdomain("Two-factor authentication adds an extra layer of security to your account") }}
+
{{ _fsdomain("In addition to your username and password, you'll need to use a code.") }}
+
+ {{ two_factor_setup_form.hidden_tag() }}
+ {{ _fsdomain("Currently setup two-factor method: %(method)s", method=primary_method) }}
+
+ {% for subfield in two_factor_setup_form.setup %}
+ {% if subfield.data in choices %}{{ render_field_with_errors(subfield) }}{% endif %}
+ {% endfor %}
+ {{ render_field_errors(two_factor_setup_form.setup) }}
+ {{ render_field(two_factor_setup_form.submit) }}
+ {% if chosen_method=="email" and chosen_method in choices %}
+ {{ _fsdomain("To complete logging in, please enter the code sent to your mail") }}
{% endif %}
- {% if chosen_method %}
- {# Hide this when first setting up #}
+ {% if chosen_method=="authenticator" and chosen_method in choices %}
-
- {{ two_factor_verify_code_form.hidden_tag() }}
- {{ render_field_with_errors(two_factor_verify_code_form.code) }}
- {{ render_field(two_factor_verify_code_form.submit) }}
-
- {% endif %}
- {% if security.support_mfa and security.multi_factor_recovery_codes %}
-
{{ _fsdomain("Recovery Codes") }}
-
- {{ _fsdomain("This application supports setting up recovery codes.") }}
-
{{ _fsdomain("You can set them up here.") }}
+
+
+ {{ _fsdomain("Open an authenticator app on your device and scan the following QRcode (or enter the code below manually) to start receiving codes:") }}
+
+
+
+ {# TODO: add width and heigth attrs #}%}
+
+
{{ authr_key }}
{% endif %}
- {% include "security/_menu.html" %}
-{% endblock %}
+ {% if chosen_method=="sms" and chosen_method in choices %}
+
{{ _fsdomain("To Which Phone Number Should We Send Code To?") }}
+ {{ two_factor_setup_form.hidden_tag() }}
+ {{ render_field_with_errors(two_factor_setup_form.phone) }}
+ {{ render_field(two_factor_setup_form.submit) }}
+ {% endif %}
+
+ {% if security.webauthn and not chosen_method %}
+
{{ _fsdomain("WebAuthn") }}
+
+ {% endif %}
+ {% if chosen_method %}
+ {# Hide this when first setting up #}
+
+
+ {{ two_factor_verify_code_form.hidden_tag() }}
+ {{ render_field_with_errors(two_factor_verify_code_form.code) }}
+ {{ render_field(two_factor_verify_code_form.submit) }}
+
+ {% endif %}
+ {% if security.support_mfa and security.multi_factor_recovery_codes %}
+
{{ _fsdomain("Recovery Codes") }}
+
+ {% endif %}
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/two_factor_verify_code.html b/flask_security/templates/security/two_factor_verify_code.html
index 63c8e27f..61cc41ff 100644
--- a/flask_security/templates/security/two_factor_verify_code.html
+++ b/flask_security/templates/security/two_factor_verify_code.html
@@ -2,26 +2,25 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, prop_next %}
{% block content %}
- {% include "security/_messages.html" %}
-
{{ _fsdomain("Two-factor Authentication") }}
-
{{ _fsdomain("Please enter your authentication code generated via: %(method)s", method=chosen_method) }}
-
- {{ two_factor_verify_code_form.hidden_tag() }}
- {{ render_field_with_errors(two_factor_verify_code_form.code, placeholder="enter code") }}
- {{ render_field(two_factor_verify_code_form.submit) }}
-
-
-
- {{ two_factor_rescue_form.hidden_tag() }}
- {{ render_field_with_errors(two_factor_rescue_form.help_setup) }}
- {% if problem=="email" %}
- {{ _fsdomain("The code for authentication was sent to your email address") }}
- {% endif %}
- {% if problem=="help" %}
- {{ _fsdomain("A mail was sent to us in order to reset your application account") }}
- {% endif %}
- {{ render_field(two_factor_rescue_form.submit) }}
-
- {% include "security/_menu.html" %}
-{% endblock %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain("Two-factor Authentication") }}
+
{{ _fsdomain("Please enter your authentication code generated via: %(method)s", method=chosen_method) }}
+
+ {{ two_factor_verify_code_form.hidden_tag() }}
+ {{ render_field_with_errors(two_factor_verify_code_form.code, placeholder="enter code") }}
+ {{ render_field(two_factor_verify_code_form.submit) }}
+
+
+
+ {{ two_factor_rescue_form.hidden_tag() }}
+ {{ render_field_with_errors(two_factor_rescue_form.help_setup) }}
+ {% if problem=="email" %}
+ {{ _fsdomain("The code for authentication was sent to your email address") }}
+ {% endif %}
+ {% if problem=="help" %}
+ {{ _fsdomain("A mail was sent to us in order to reset your application account") }}
+ {% endif %}
+ {{ render_field(two_factor_rescue_form.submit) }}
+
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/us_setup.html b/flask_security/templates/security/us_setup.html
index 0af21599..928d791f 100644
--- a/flask_security/templates/security/us_setup.html
+++ b/flask_security/templates/security/us_setup.html
@@ -24,82 +24,75 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_errors, render_form_errors %}
{% block content %}
- {% include "security/_messages.html" %}
-
{{ _fsdomain("Setup Unified Sign In") }}
-
- {{ us_setup_form.hidden_tag() }}
- {{ render_form_errors(us_setup_form) }}
- {% if setup_methods %}
- {{ _fsdomain("Currently active sign in options:") }}
- {% if active_methods %}
- {{ ", ".join(active_methods) }}
- {% else %}
- None.
+ {% include "security/_messages.html" %}
+ {{ _fsdomain("Setup Unified Sign In") }}
+
+ {{ us_setup_form.hidden_tag() }}
+ {{ render_form_errors(us_setup_form) }}
+ {% if setup_methods %}
+
+ {{ _fsdomain("Currently active sign in options:") }}
+
+ {% if active_methods %}
+ {{ ", ".join(active_methods) }}
+ {% else %}
+ None.
+ {% endif %}
+
+
+ {{ us_setup_form.chosen_method.label }}
+
+ {% for subfield in us_setup_form.chosen_method %}{{ render_field_with_errors(subfield) }}{% endfor %}
+ {{ render_field_errors(us_setup_form.chosen_method) }}
+
+
+ {% if "sms" in available_methods and "sms" not in active_methods %}
+ {{ render_field_with_errors(us_setup_form.phone) }}
{% endif %}
-
-
- {{ us_setup_form.chosen_method.label }}
-
- {% for subfield in us_setup_form.chosen_method %}
- {{ render_field_with_errors(subfield) }}
- {% endfor %}
- {{ render_field_errors(us_setup_form.chosen_method) }}
-
-
+
+ {% if us_setup_form.delete_method.choices and not state %}
+ {# don't show delete if we're trying to validate a setup #}
+ {{ us_setup_form.delete_method.label }}
- {% if "sms" in available_methods and "sms" not in active_methods %}
- {{ render_field_with_errors(us_setup_form.phone) }}
- {% endif %}
+ {% for subfield in us_setup_form.delete_method %}{{ render_field_with_errors(subfield) }}{% endfor %}
+ {{ render_field_errors(us_setup_form.delete_method) }}
- {% if us_setup_form.delete_method.choices and not state %}
- {# don't show delete if we're trying to validate a setup #}
- {{ us_setup_form.delete_method.label }}
-
- {% for subfield in us_setup_form.delete_method %}
- {{ render_field_with_errors(subfield) }}
- {% endfor %}
- {{ render_field_errors(us_setup_form.delete_method) }}
+ {% endif %}
+
{{ render_field(us_setup_form.submit) }}
+ {% if chosen_method == "authenticator" %}
+
+
+
+ {{ _fsdomain("Open an authenticator app on your device and scan the following QRcode (or enter the code below manually) to start receiving codes:") }}
- {% endif %}
-
{{ render_field(us_setup_form.submit) }}
-
- {% if chosen_method == "authenticator" %}
-
-
-
- {{ _fsdomain("Open an authenticator app on your device and scan the following QRcode (or enter the code below manually) to start receiving codes:") }}
-
-
-
-
-
- {{ authr_key }}
-
+
+
+ {# TODO: add width and heigth attrs #}%}
- {% endif %}
- {% else %}
-
{{ _fsdomain("No methods have been enabled - nothing to setup") }}
+
{{ authr_key }}
+
{% endif %}
-
- {% if state %}
- {# Completing setup by entering code #}
-
-
{{ _fsdomain("Enter code here to complete setup") }}
-
- {{ us_setup_validate_form.hidden_tag() }}
- {{ render_field_with_errors(us_setup_validate_form.passcode) }}
- {{ render_field(us_setup_validate_form.submit) }}
-
+ {% else %}
+
{{ _fsdomain("No methods have been enabled - nothing to setup") }}
{% endif %}
- {% if security.webauthn %}
-
-
WebAuthn
-
- {% endif %}
- {% include "security/_menu.html" %}
-{% endblock %}
+
+ {% if state %}
+ {# Completing setup by entering code #}
+
+
{{ _fsdomain("Enter code here to complete setup") }}
+
+ {{ us_setup_validate_form.hidden_tag() }}
+ {{ render_field_with_errors(us_setup_validate_form.passcode) }}
+ {{ render_field(us_setup_validate_form.submit) }}
+
+ {% endif %}
+ {% if security.webauthn %}
+
+
WebAuthn
+
+ {% endif %}
+ {% include "security/_menu.html" %}
+{% endblock content %}
diff --git a/flask_security/templates/security/us_signin.html b/flask_security/templates/security/us_signin.html
index 81764409..b29a43cb 100644
--- a/flask_security/templates/security/us_signin.html
+++ b/flask_security/templates/security/us_signin.html
@@ -2,34 +2,30 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_errors, render_form_errors, prop_next %}
{% block content %}
- {% include "security/_messages.html" %}
-
{{ _fsdomain("Sign In") }}
-
- {{ us_signin_form.hidden_tag() }}
- {{ render_form_errors(us_signin_form) }}
- {{ render_field_with_errors(us_signin_form.identity) }}
- {{ render_field_with_errors(us_signin_form.passcode) }}
- {{ render_field_with_errors(us_signin_form.remember) }}
- {{ render_field(us_signin_form.submit) }}
- {% if code_methods %}
- {{ _fsdomain("Request one-time code be sent") }}
- {% for subfield in us_signin_form.chosen_method %}
- {% if subfield.data in code_methods %}
- {{ render_field_with_errors(subfield) }}
- {% endif %}
- {% endfor %}
- {{ render_field_errors(us_signin_form.chosen_method) }}
- {{ render_field(us_signin_form.submit_send_code, formaction=url_for_security('us_signin_send_code')) }}
- {% endif %}
-
+ {% include "security/_messages.html" %}
+
{{ _fsdomain("Sign In") }}
+
+ {{ us_signin_form.hidden_tag() }}
+ {{ render_form_errors(us_signin_form) }}
+ {{ render_field_with_errors(us_signin_form.identity) }}
+ {{ render_field_with_errors(us_signin_form.passcode) }}
+ {{ render_field_with_errors(us_signin_form.remember) }}
+ {{ render_field(us_signin_form.submit) }}
+ {% if code_methods %}
+ {{ _fsdomain("Request one-time code be sent") }}
+ {% for subfield in us_signin_form.chosen_method %}
+ {% if subfield.data in code_methods %}{{ render_field_with_errors(subfield) }}{% endif %}
+ {% endfor %}
+ {{ render_field_errors(us_signin_form.chosen_method) }}
+ {{ render_field(us_signin_form.submit_send_code, formaction=url_for_security('us_signin_send_code')) }}
+ {% endif %}
+
{% if security.webauthn %}
{{ _fsdomain("Use WebAuthn to Sign In") }}
-
-
-
+
+
+
{% endif %}
@@ -38,12 +34,11 @@ {{ _fsdomain("Use WebAuthn to Sign In") }}
{{ _fsdomain("Use Social Oauth to Sign In") }}
{% for provider in security.oauthglue.provider_names %}
-
-
+
+
{% endfor %}
{% endif %}
{% include "security/_menu.html" %}
-{% endblock %}
+{% endblock content %}
diff --git a/flask_security/templates/security/us_verify.html b/flask_security/templates/security/us_verify.html
index 99cfe68a..0efd6378 100644
--- a/flask_security/templates/security/us_verify.html
+++ b/flask_security/templates/security/us_verify.html
@@ -2,35 +2,31 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, render_field_errors, prop_next %}
{% block content %}
- {% include "security/_messages.html" %}
- {{ _fsdomain("Please Reauthenticate") }}
-
- {{ us_verify_form.hidden_tag() }}
- {{ render_field_with_errors(us_verify_form.passcode) }}
- {{ render_field(us_verify_form.submit) }}
- {% if code_methods %}
- {{ _fsdomain("Request one-time code be sent") }}
- {% for subfield in us_verify_form.chosen_method %}
- {% if subfield.data in code_methods %}
- {{ render_field_with_errors(subfield) }}
- {% endif %}
- {% endfor %}
- {{ render_field_errors(us_verify_form.chosen_method) }}
- {% if code_sent %}
- {{ _fsdomain("Code has been sent") }}
- {% endif %}
-
{{ render_field(us_verify_form.submit_send_code, formaction=url_for_security("us_verify_send_code")~prop_next()) }}
- {% endif %}
-
- {% if has_webauthn_verify_credential %}
-
-
{{ _fsdomain("Use a WebAuthn Security Key to Reauthenticate") }}
-
- {{ wan_verify_form.hidden_tag() }}
- {{ render_field(wan_verify_form.submit) }}
-
- {% endif %}
+ {% include "security/_messages.html" %}
+
{{ _fsdomain("Please Reauthenticate") }}
+
+ {{ us_verify_form.hidden_tag() }}
+ {{ render_field_with_errors(us_verify_form.passcode) }}
+ {{ render_field(us_verify_form.submit) }}
+ {% if code_methods %}
+ {{ _fsdomain("Request one-time code be sent") }}
+ {% for subfield in us_verify_form.chosen_method %}
+ {% if subfield.data in code_methods %}{{ render_field_with_errors(subfield) }}{% endif %}
+ {% endfor %}
+ {{ render_field_errors(us_verify_form.chosen_method) }}
+ {% if code_sent %}{{ _fsdomain("Code has been sent") }}
{% endif %}
+
+ {{ render_field(us_verify_form.submit_send_code, formaction=url_for_security("us_verify_send_code")~prop_next()) }}
+
+ {% endif %}
+
+ {% if has_webauthn_verify_credential %}
+
+
{{ _fsdomain("Use a WebAuthn Security Key to Reauthenticate") }}
+
+ {{ wan_verify_form.hidden_tag() }}
+ {{ render_field(wan_verify_form.submit) }}
+
+ {% endif %}
{% include "security/_menu.html" %}
-{% endblock %}
+{% endblock content %}
diff --git a/flask_security/templates/security/verify.html b/flask_security/templates/security/verify.html
index b0875581..d90bd028 100644
--- a/flask_security/templates/security/verify.html
+++ b/flask_security/templates/security/verify.html
@@ -2,21 +2,19 @@
{% from "security/_macros.html" import render_field_with_errors, render_field, prop_next %}
{% block content %}
- {% include "security/_messages.html" %}
-
{{ _fsdomain("Please Reauthenticate") }}
-
- {{ verify_form.hidden_tag() }}
- {{ render_field_with_errors(verify_form.password) }}
- {{ render_field(verify_form.submit) }}
+ {% include "security/_messages.html" %}
+ {{ _fsdomain("Please Reauthenticate") }}
+
+ {{ verify_form.hidden_tag() }}
+ {{ render_field_with_errors(verify_form.password) }}
+ {{ render_field(verify_form.submit) }}
+
+ {% if has_webauthn_verify_credential %}
+
+
{{ _fsdomain("Use a WebAuthn Security Key to Reauthenticate") }}
+
+ {{ wan_verify_form.hidden_tag() }}
+ {{ render_field(wan_verify_form.submit) }}
- {% if has_webauthn_verify_credential %}
-
-
{{ _fsdomain("Use a WebAuthn Security Key to Reauthenticate") }}
-
- {{ wan_verify_form.hidden_tag() }}
- {{ render_field(wan_verify_form.submit) }}
-
- {% endif %}
-{% endblock %}
+ {% endif %}
+{% endblock content %}
diff --git a/flask_security/templates/security/wan_register.html b/flask_security/templates/security/wan_register.html
index de9de767..a54c09d8 100644
--- a/flask_security/templates/security/wan_register.html
+++ b/flask_security/templates/security/wan_register.html
@@ -7,8 +7,7 @@
{% block head_scripts %}
{{ super() }}
-
+
{% endblock head_scripts %}
@@ -18,63 +17,58 @@
{{ _fsdomain("Setup New WebAuthn Security Key") }}
{% if not credential_options %}
{# Initial form to get CreateOptions #}
{{ _fsdomain("Start by providing a unique name for your new security key:") }}
-
- {{ wan_register_form.hidden_tag() }}
- {{ render_field_with_errors(wan_register_form.name) }}
- {# Default is just second factor #}
- {% if security.wan_allow_as_first_factor %}
-
- {% for subfield in wan_register_form.usage %}
- {{ render_field_with_errors(subfield) }}
- {% endfor %}
-
- {% endif %}
- {{ render_field(wan_register_form.submit) }}
+
+ {{ wan_register_form.hidden_tag() }}
+ {{ render_field_with_errors(wan_register_form.name) }}
+ {# Default is just second factor #}
+ {% if security.wan_allow_as_first_factor %}
+
+ {% for subfield in wan_register_form.usage %}{{ render_field_with_errors(subfield) }}{% endfor %}
+
+ {% endif %}
+ {{ render_field(wan_register_form.submit) }}
{% else %}
-
+
{{ wan_register_response_form.hidden_tag() }}
-
+
{% endif %}
-
{% if registered_credentials %}
{{ _fsdomain("Currently registered security keys:") }}
{% set listing = _fsdomain('Nickname: "%s" Usage: "%s" Transports: "%s" Discoverable: "%s" Device Type: "%s" Backed up? "%s" Last used on: %s') %}
{% for cred in registered_credentials %}
- {{ listing|format(cred.name, cred.usage, cred.transports|join(", "), cred.discoverable, cred.device_type, cred.backup_state, cred.lastuse)}}
+
+ {{ listing|format(cred.name, cred.usage, cred.transports|join(", "), cred.discoverable, cred.device_type, cred.backup_state, cred.lastuse) }}
+
{% endfor %}
{% endif %}
-
{% if wan_delete_form %}
{{ _fsdomain("Delete Existing WebAuthn Security Key") }}
-
- {{ wan_delete_form.hidden_tag() }}
- {{ render_field_with_errors(wan_delete_form.name) }}
- {{ render_field(wan_delete_form.submit) }}
-
+
+ {{ wan_delete_form.hidden_tag() }}
+ {{ render_field_with_errors(wan_delete_form.name) }}
+ {{ render_field(wan_delete_form.submit) }}
+
{% endif %}
{% if security.support_mfa and security.multi_factor_recovery_codes %}
@@ -83,6 +77,6 @@
{{ _fsdomain("Recovery Codes") }}
{{ _fsdomain("This application supports setting up recovery codes.") }}
{{ _fsdomain("You can set them up here.") }}
- {% endif %}
+ {% endif %}
{% include "security/_menu.html" %}
-{% endblock %}
+{% endblock content %}
diff --git a/flask_security/templates/security/wan_signin.html b/flask_security/templates/security/wan_signin.html
index f93386a0..05b486d5 100644
--- a/flask_security/templates/security/wan_signin.html
+++ b/flask_security/templates/security/wan_signin.html
@@ -7,8 +7,7 @@
{% block head_scripts %}
{{ super() }}
-
+
{% endblock head_scripts %}
@@ -20,8 +19,7 @@
{{ _fsdomain("Sign In Using WebAuthn Security Key") }}
{{ _fsdomain("Use Your WebAuthn Security Key as a Second Factor") }}
{% endif %}
{% if not credential_options %}
-
+
{{ wan_signin_form.hidden_tag() }}
{% if not is_secondary %}
{{ render_field_with_errors(wan_signin_form.identity) }}
@@ -31,8 +29,7 @@ {{ _fsdomain("Use Your WebAuthn Security Key as a Second Factor") }}
{{ render_field(wan_signin_form.submit) }}
{% else %}
-
+
{{ wan_signin_response_form.hidden_tag() }}
{{ render_field_errors(wan_signin_form.remember) }}
{# the following is important even though it is hidden - some browsers
@@ -41,21 +38,21 @@ {{ _fsdomain("Use Your WebAuthn Security Key as a Second Factor") }}
{{ render_field(wan_signin_response_form.credential) }}
-
+ });
+
{% endif %}
-{% endblock %}
+{% endblock content %}
diff --git a/flask_security/templates/security/wan_verify.html b/flask_security/templates/security/wan_verify.html
index 264db3dc..38e91337 100644
--- a/flask_security/templates/security/wan_verify.html
+++ b/flask_security/templates/security/wan_verify.html
@@ -12,8 +12,7 @@
{% block head_scripts %}
{{ super() }}
-
+
{% endblock head_scripts %}
@@ -21,32 +20,30 @@
{% include "security/_messages.html" %}
{{ _fsdomain("Please Re-Authenticate Using Your WebAuthn Security Key") }}
{% if not credential_options %}
-
- {{ wan_verify_form.hidden_tag() }}
- {{ render_field(wan_verify_form.submit) }}
+
+ {{ wan_verify_form.hidden_tag() }}
+ {{ render_field(wan_verify_form.submit) }}
{% else %}
-
+
{{ wan_signin_response_form.hidden_tag() }}
-
+ });
+
{% endif %}
-{% endblock %}
+{% endblock content %}
diff --git a/requirements/tests.txt b/requirements/tests.txt
index 8e8466bc..cfbba15e 100644
--- a/requirements/tests.txt
+++ b/requirements/tests.txt
@@ -13,6 +13,7 @@ bleach
check-manifest
coverage
cryptography
+djlint
python-dateutil
mongoengine
mongomock