From 6ff5428edf74176a53a8d2a2e843969646d199de Mon Sep 17 00:00:00 2001 From: Arne Gudermann Date: Thu, 13 Jul 2023 21:55:10 +0200 Subject: [PATCH 1/8] Add Templates --- deploy/html/user_secondfactor_add.html | 18 ++++++++++++++++++ deploy/html/user_secondfactor_add_success.html | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 deploy/html/user_secondfactor_add.html create mode 100644 deploy/html/user_secondfactor_add_success.html diff --git a/deploy/html/user_secondfactor_add.html b/deploy/html/user_secondfactor_add.html new file mode 100644 index 0000000..725bd98 --- /dev/null +++ b/deploy/html/user_secondfactor_add.html @@ -0,0 +1,18 @@ +{%- extends "viur_base.html" %} + +{%- block content %} +

Add Second Factor

+

Please scan the QR code with your Authenticator App and Enter the OTP token in the input below

+ {{otp_uri_to_qrcode(otp_uri)}} + +
+ + +
+ + +
+ + +
+{%- endblock content %} diff --git a/deploy/html/user_secondfactor_add_success.html b/deploy/html/user_secondfactor_add_success.html new file mode 100644 index 0000000..5ad2fae --- /dev/null +++ b/deploy/html/user_secondfactor_add_success.html @@ -0,0 +1,16 @@ +{% extends "viur_base.html" %} + +{% block content %} +

Second Factor

+ +
+ {{ embedSvg("icon-check") }} +
+

Second Factor Add success !

+

Your Second Factor has been added successfully.

+
+
+ + Login + +{% endblock %} From 800977986a07333294ed70f72bece6e0e62d7820 Mon Sep 17 00:00:00 2001 From: Arne Gudermann Date: Fri, 25 Aug 2023 17:55:22 +0200 Subject: [PATCH 2/8] Add href for otp_uri --- deploy/html/user_secondfactor_add.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/html/user_secondfactor_add.html b/deploy/html/user_secondfactor_add.html index 725bd98..fcc95f6 100644 --- a/deploy/html/user_secondfactor_add.html +++ b/deploy/html/user_secondfactor_add.html @@ -3,7 +3,10 @@ {%- block content %}

Add Second Factor

Please scan the QR code with your Authenticator App and Enter the OTP token in the input below

- {{otp_uri_to_qrcode(otp_uri)}} + + + {{otp_uri_to_qrcode(otp_uri)}} +
From 54e95f304289d8b0e4541ea1be13f93032ef8143 Mon Sep 17 00:00:00 2001 From: Sven Eberth Date: Wed, 30 Aug 2023 21:31:26 +0200 Subject: [PATCH 3/8] Adjust template `user_login_secondfactor` --- deploy/html/user_login_secondfactor.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/deploy/html/user_login_secondfactor.html b/deploy/html/user_login_secondfactor.html index 75eb91d..11199fa 100644 --- a/deploy/html/user_login_secondfactor.html +++ b/deploy/html/user_login_secondfactor.html @@ -1,17 +1,26 @@ {%- extends "viur_base.html" %} {%- block content %} - {% if action == "otp" %} -

OTP

+ {% if action == "otp" or action == "authenticatorOTP" %} +

{{ action }}

- + + {% for error in skel["errors"] %} +
+ {{ embedSvg("icon-cross") }} +
+

{{ error["errorMessage"] }}

+
+
+ {% endfor %} +
{{ embedSvg("icon-cross") }}

Error!

-

The entered token was invaild!

+

The entered token was invalid!

From a9791c6c06faa4b7e5bb5ffc9b0a48d41e74906e Mon Sep 17 00:00:00 2001 From: Arne Gudermann Date: Tue, 5 Sep 2023 15:18:47 +0200 Subject: [PATCH 4/8] Change Template --- deploy/html/user_login_secondfactor.html | 8 ++--- deploy/html/user_secondfactor_add.html | 40 ++++++++++++++++-------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/deploy/html/user_login_secondfactor.html b/deploy/html/user_login_secondfactor.html index 11199fa..efd983e 100644 --- a/deploy/html/user_login_secondfactor.html +++ b/deploy/html/user_login_secondfactor.html @@ -1,10 +1,10 @@ {%- extends "viur_base.html" %} {%- block content %} - {% if action == "otp" or action == "authenticatorOTP" %} +

{{ action }}

- + {% for error in skel["errors"] %} @@ -31,7 +31,5 @@

Error!

- {% else %} -
Unimplemented second factor action: {{ action }}
- {% endif %} + {%- endblock content %} diff --git a/deploy/html/user_secondfactor_add.html b/deploy/html/user_secondfactor_add.html index fcc95f6..76ac0b7 100644 --- a/deploy/html/user_secondfactor_add.html +++ b/deploy/html/user_secondfactor_add.html @@ -1,21 +1,35 @@ {%- extends "viur_base.html" %} {%- block content %} -

Add Second Factor

-

Please scan the QR code with your Authenticator App and Enter the OTP token in the input below

- - {{otp_uri_to_qrcode(otp_uri)}} - +

SecondFactor

-
- + + -
- - -
+ {% for error in skel["errors"] %} +
+ {{ embedSvg("icon-cross") }} +
+

{{ error["errorMessage"] }}

+
+
+ {% endfor %} + +
+ {{ embedSvg("icon-cross") }} +
+

Error!

+

The entered token was invalid!

+
+
+ +
+ + +
+ + +
- - {%- endblock content %} From 0cfde71f06edd44f73c303c20668ee126c477392 Mon Sep 17 00:00:00 2001 From: Arne Gudermann Date: Tue, 5 Sep 2023 15:19:51 +0200 Subject: [PATCH 5/8] Change Template --- deploy/html/user_login_secondfactor.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/html/user_login_secondfactor.html b/deploy/html/user_login_secondfactor.html index efd983e..76ac0b7 100644 --- a/deploy/html/user_login_secondfactor.html +++ b/deploy/html/user_login_secondfactor.html @@ -2,7 +2,7 @@ {%- block content %} -

{{ action }}

+

SecondFactor

From 912345edea774963f4e92a4ef38ede438f24047e Mon Sep 17 00:00:00 2001 From: Sven Eberth Date: Fri, 8 Sep 2023 21:26:17 +0200 Subject: [PATCH 6/8] Revert "Change Template" This reverts commit 0cfde71f06edd44f73c303c20668ee126c477392. --- deploy/html/user_login_secondfactor.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/html/user_login_secondfactor.html b/deploy/html/user_login_secondfactor.html index 76ac0b7..efd983e 100644 --- a/deploy/html/user_login_secondfactor.html +++ b/deploy/html/user_login_secondfactor.html @@ -2,7 +2,7 @@ {%- block content %} -

SecondFactor

+

{{ action }}

From 0d1098807a57f3e769309901aa52cd974fedb837 Mon Sep 17 00:00:00 2001 From: Sven Eberth Date: Fri, 8 Sep 2023 21:26:20 +0200 Subject: [PATCH 7/8] Revert "Change Template" This reverts commit a9791c6c06faa4b7e5bb5ffc9b0a48d41e74906e. --- deploy/html/user_login_secondfactor.html | 8 +++-- deploy/html/user_secondfactor_add.html | 40 ++++++++---------------- 2 files changed, 18 insertions(+), 30 deletions(-) diff --git a/deploy/html/user_login_secondfactor.html b/deploy/html/user_login_secondfactor.html index efd983e..11199fa 100644 --- a/deploy/html/user_login_secondfactor.html +++ b/deploy/html/user_login_secondfactor.html @@ -1,10 +1,10 @@ {%- extends "viur_base.html" %} {%- block content %} - + {% if action == "otp" or action == "authenticatorOTP" %}

{{ action }}

- + {% for error in skel["errors"] %} @@ -31,5 +31,7 @@

Error!

- + {% else %} +
Unimplemented second factor action: {{ action }}
+ {% endif %} {%- endblock content %} diff --git a/deploy/html/user_secondfactor_add.html b/deploy/html/user_secondfactor_add.html index 76ac0b7..fcc95f6 100644 --- a/deploy/html/user_secondfactor_add.html +++ b/deploy/html/user_secondfactor_add.html @@ -1,35 +1,21 @@ {%- extends "viur_base.html" %} {%- block content %} +

Add Second Factor

+

Please scan the QR code with your Authenticator App and Enter the OTP token in the input below

-

SecondFactor

+ + {{otp_uri_to_qrcode(otp_uri)}} + -
- + + - {% for error in skel["errors"] %} -
- {{ embedSvg("icon-cross") }} -
-

{{ error["errorMessage"] }}

-
-
- {% endfor %} - -
- {{ embedSvg("icon-cross") }} -
-

Error!

-

The entered token was invalid!

-
-
- -
- - -
- - -
+
+ + +
+ + {%- endblock content %} From 6d6eac9cdaf929a5b51dc2232067baaa7b8b0a94 Mon Sep 17 00:00:00 2001 From: Sven Eberth Date: Fri, 8 Sep 2023 23:30:22 +0200 Subject: [PATCH 8/8] Adjust templates for latest core (including bugfixes #844, #845, #846) --- deploy/html/user_login_secondfactor.html | 69 +++++++++++-------- deploy/html/user_second_factor_choice.html | 17 +++++ deploy/html/user_secondfactor_add.html | 38 ++++++---- .../html/user_secondfactor_add_success.html | 19 +++-- 4 files changed, 92 insertions(+), 51 deletions(-) create mode 100644 deploy/html/user_second_factor_choice.html diff --git a/deploy/html/user_login_secondfactor.html b/deploy/html/user_login_secondfactor.html index 11199fa..d07a42b 100644 --- a/deploy/html/user_login_secondfactor.html +++ b/deploy/html/user_login_secondfactor.html @@ -1,37 +1,50 @@ {%- extends "viur_base.html" %} {%- block content %} - {% if action == "otp" or action == "authenticatorOTP" %} -

{{ action }}

+

{{ name }}

-
- + {% if action_name == "otp" or action_name == "authenticator_otp" %} + {% if action_name == "otp" -%} +

{% translate "user_second_factor_otp_text", "Please enter your OTP token from your generator." %}

+ {%- elif action_name == "authenticator_otp" -%} +

{% translate "user_second_factor_authenticator_otp_text", "Please enter your OTP token from your authenticator app." %}

+ {%- endif %} - {% for error in skel["errors"] %} -
- {{ embedSvg("icon-cross") }} -
-

{{ error["errorMessage"] }}

-
-
- {% endfor %} + + -
- {{ embedSvg("icon-cross") }} -
-

Error!

-

The entered token was invalid!

-
-
+ {% for error in skel["errors"] %} +
+ {{ embedSvg("icon-cross") }} +
+

{{ error["errorMessage"] }}

+
+
+ {% endfor %} -
- - -
+
+ {{ embedSvg("icon-cross") }} +
+

{% translate "error", "Error!" %}

+

{% translate "user_second_factor_invalid_token", "The entered token was invalid!" %}

+
+
- -
- {% else %} -
Unimplemented second factor action: {{ action }}
- {% endif %} +
+ + +
+ + + + {% else %} +

+ {% translate "user_second_factor_unimplemented", "Unimplemented second factor action:" %} {{ name }} + ({{ action_name }}) +

+ {% endif %} {%- endblock content %} diff --git a/deploy/html/user_second_factor_choice.html b/deploy/html/user_second_factor_choice.html new file mode 100644 index 0000000..78abe13 --- /dev/null +++ b/deploy/html/user_second_factor_choice.html @@ -0,0 +1,17 @@ +{%- extends "viur_base.html" %} + +{%- block content %} +

{% translate "user_second_factor_choice_headline", "Second Factor" %}

+ +

{% translate "user_second_factor_choice_text", "Your account is secured by a second factor. Please choose with which one you want to continue the login." %}

+ +

+ {% translate "user_second_factor_choice_list", "Available factors" %}
+ + {% for second_factor in second_factors %} + {{ translate(second_factor.NAME) }} + {% if not loop.last %}
{% endif %} + {% endfor %} +

+ +{%- endblock content %} diff --git a/deploy/html/user_secondfactor_add.html b/deploy/html/user_secondfactor_add.html index fcc95f6..310dfa6 100644 --- a/deploy/html/user_secondfactor_add.html +++ b/deploy/html/user_secondfactor_add.html @@ -1,21 +1,33 @@ {%- extends "viur_base.html" %} {%- block content %} -

Add Second Factor

-

Please scan the QR code with your Authenticator App and Enter the OTP token in the input below

+

{% translate "user_second_factor_add_headline", "Add Second Factor" %}: {{ name }}

- - {{otp_uri_to_qrcode(otp_uri)}} - + {% if action_name == "authenticator_otp" %} +

{% translate "user_second_factor_add_authenticator_otp_text", "Please scan the QR code below with your authentication app (Google Authenticator, Authy, ...) and then enter the OTP token in the field below to confirm successful setup." %}

-
- + + {{ qrcode(otp_uri) }} + -
- - -
+ + - -
+
+ + +
+ + + + {% else %} +

+ {% translate "user_second_factor_unimplemented", "Unimplemented second factor action:" %} {{ name }} + ({{ action_name }}) +

+ {% endif %} {%- endblock content %} diff --git a/deploy/html/user_secondfactor_add_success.html b/deploy/html/user_secondfactor_add_success.html index 5ad2fae..2664f69 100644 --- a/deploy/html/user_secondfactor_add_success.html +++ b/deploy/html/user_secondfactor_add_success.html @@ -1,16 +1,15 @@ {% extends "viur_base.html" %} {% block content %} -

Second Factor

+

{% translate "user_second_factor_add_headline", "Add Second Factor" %}

-
- {{ embedSvg("icon-check") }} -
-

Second Factor Add success !

-

Your Second Factor has been added successfully.

-
-
- - Login +
+ {{ embedSvg("icon-check") }} +
+

{% translate "user_second_factor_add_success_msg", "Done" %}

+

{% translate "user_second_factor_add_success_text", "Your second factor has been successfully added." %}

+
+
+ {% translate "login", "Login" %} {% endblock %}