From 906ecc021b68d8e1073699c58f940f2b6e6551fa Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Wed, 8 Jul 2020 19:19:29 +0200 Subject: [PATCH] Improve 2FA views --- BTCPayServer/Views/Manage/Disable2fa.cshtml | 18 +++---- .../Views/Manage/EnableAuthenticator.cshtml | 39 +++++++++------ .../Views/Manage/GenerateRecoveryCodes.cshtml | 8 +-- .../Views/Manage/ResetAuthenticator.cshtml | 10 ++-- .../Manage/TwoFactorAuthentication.cshtml | 50 ++++++++++++------- 5 files changed, 74 insertions(+), 51 deletions(-) diff --git a/BTCPayServer/Views/Manage/Disable2fa.cshtml b/BTCPayServer/Views/Manage/Disable2fa.cshtml index dd887ef5e..0e6db3466 100644 --- a/BTCPayServer/Views/Manage/Disable2fa.cshtml +++ b/BTCPayServer/Views/Manage/Disable2fa.cshtml @@ -2,18 +2,16 @@ ViewData.SetActivePageAndTitle(ManageNavPages.TwoFactorAuthentication, "Disable two-factor authentication (2FA)"); } -

@ViewData["Title"]

- diff --git a/BTCPayServer/Views/Manage/EnableAuthenticator.cshtml b/BTCPayServer/Views/Manage/EnableAuthenticator.cshtml index 54c0d7e7d..69be42229 100644 --- a/BTCPayServer/Views/Manage/EnableAuthenticator.cshtml +++ b/BTCPayServer/Views/Manage/EnableAuthenticator.cshtml @@ -1,31 +1,40 @@ @model EnableAuthenticatorViewModel @{ - ViewData.SetActivePageAndTitle(ManageNavPages.TwoFactorAuthentication, "Enable authenticator"); + ViewData.SetActivePageAndTitle(ManageNavPages.TwoFactorAuthentication, "Enable authenticator app"); }

To use an authenticator app go through the following steps:

    -
  1. -

    - Download a two-factor authenticator app like Microsoft Authenticator for - Android and - iOS or - Google Authenticator for - Android and - iOS. -

    +
  2. +
    Download a two-factor authenticator app like …
    +
      +
    • + Microsoft Authenticator for + Android or + iOS +
    • +
    • + Google Authenticator for + Android or + iOS +
    • +
  3. -
  4. -

    Scan the QR Code or enter this key @Model.SharedKey into your two factor authenticator app. Spaces and casing do not matter.

    +
  5. +

    Scan the QR Code or enter the following key into your two factor authenticator app:

    +

    + @Model.SharedKey + (spaces and casing do not matter) +

    -
  6. - Once you have scanned the QR code or input the key above, your two factor authentication app will provide you - with a unique code. Enter the code in the confirmation box below. + Your two factor authenticator app will provide you with a unique code. +
    + Enter the code in the confirmation box below.

    diff --git a/BTCPayServer/Views/Manage/GenerateRecoveryCodes.cshtml b/BTCPayServer/Views/Manage/GenerateRecoveryCodes.cshtml index 20d7f58e7..0e1b83dc1 100644 --- a/BTCPayServer/Views/Manage/GenerateRecoveryCodes.cshtml +++ b/BTCPayServer/Views/Manage/GenerateRecoveryCodes.cshtml @@ -4,11 +4,11 @@ } diff --git a/BTCPayServer/Views/Manage/ResetAuthenticator.cshtml b/BTCPayServer/Views/Manage/ResetAuthenticator.cshtml index 350def4eb..027811e12 100644 --- a/BTCPayServer/Views/Manage/ResetAuthenticator.cshtml +++ b/BTCPayServer/Views/Manage/ResetAuthenticator.cshtml @@ -3,12 +3,14 @@ } diff --git a/BTCPayServer/Views/Manage/TwoFactorAuthentication.cshtml b/BTCPayServer/Views/Manage/TwoFactorAuthentication.cshtml index e599b2b92..53bb2567e 100644 --- a/BTCPayServer/Views/Manage/TwoFactorAuthentication.cshtml +++ b/BTCPayServer/Views/Manage/TwoFactorAuthentication.cshtml @@ -8,39 +8,53 @@ if(Model.RecoveryCodesLeft == 0) {
    - You have no recovery codes left. -

    You must generate a new set of recovery codes before you can log in with a recovery code.

    +

    + + You have no recovery codes left. +

    +

    You must generate a new set of recovery codes before you can log in with a recovery code.

    } else if(Model.RecoveryCodesLeft == 1) {
    - You have 1 recovery code left. -

    You can generate a new set of recovery codes.

    +

    + + You have 1 recovery code left. +

    +

    You can generate a new set of recovery codes.

    } else if(Model.RecoveryCodesLeft <= 3) {
    - You have @Model.RecoveryCodesLeft recovery codes left. -

    You should generate a new set of recovery codes.

    +

    + + You have @Model.RecoveryCodesLeft recovery codes left. +

    +

    You should generate a new set of recovery codes.

    } - - Disable 2FA - Reset recovery codes +
    Your current 2FA
    + }
    Authenticator app
    -@if(!Model.HasAuthenticator) -{ - Add authenticator app -} -else -{ - Configure authenticator app - Reset authenticator key -} + @section Scripts { @await Html.PartialAsync("_ValidationScriptsPartial")