diff --git a/assets/js/clipboard_utils.js b/assets/js/clipboard_utils.js new file mode 100644 index 0000000..3677be5 --- /dev/null +++ b/assets/js/clipboard_utils.js @@ -0,0 +1,12 @@ +function copyToClipboard(str) { + const input = document.createElement("input"); + input.value = str; + + document.body.appendChild(input); + + input.select(); + input.setSelectionRange(0, str.length); + document.execCommand("copy"); + + input.remove(); +} diff --git a/src/controllers/two_factors_controller.rs b/src/controllers/two_factors_controller.rs index c33bf88..127185b 100644 --- a/src/controllers/two_factors_controller.rs +++ b/src/controllers/two_factors_controller.rs @@ -61,7 +61,7 @@ pub async fn add_totp_factor_route(user: CurrentUser, app_conf: web::Data -

On this page you can configure a new Authenticator app. Please use the authenticator app to scan the QR code.

+

On this page you can configure a new Authenticator app. Please use an authenticator app to scan the QR code.

-

Note: if you have not an authenticator app yet, you might want to use - FreeOTP - Authenticator for example.

+

Note: if you have not an authenticator app yet, you might want to use + FreeOTP + Authenticator for example.

- + -

If you can't scan the QrCode, please use the following parameters instead:

- +

If you can't scan the QrCode, please use the following parameters instead:

+ -

Once you have scanned the QrCode, please generate a first QrCode and type it below:

+

Once you have scanned the QrCode, please generate a code and type it below:

-TODO : add form +
+ + + Please give a name to your device to identity it more easily later. +
+ +
+ + + Check that your authenticator app is working correctly by typing a first + code. +
+ + + + {% endblock content %} diff --git a/templates/settings/two_factors_page.html b/templates/settings/two_factors_page.html index dc90303..cc7de08 100644 --- a/templates/settings/two_factors_page.html +++ b/templates/settings/two_factors_page.html @@ -11,7 +11,7 @@

- Add One Time Password (OTP) factor + Add Authenticator App

TODO : show the list of currently registered 2 factors methods