Add user setting page for totp

This commit is contained in:
eikek
2021-08-30 23:54:37 +02:00
parent 309a52393a
commit 999c39833a
7 changed files with 648 additions and 1 deletions

View File

@@ -0,0 +1,100 @@
{-
Copyright 2020 Docspell Contributors
SPDX-License-Identifier: GPL-3.0-or-later
-}
module Messages.Comp.OtpSetup exposing
( Texts
, de
, gb
)
import Http
import Messages.Comp.HttpError
import Messages.DateFormat
import Messages.UiLanguage
type alias Texts =
{ httpError : Http.Error -> String
, formatDateShort : Int -> String
, errorTitle : String
, stateErrorInfoText : String
, errorGeneratingQR : String
, initErrorInfo : String
, confirmErrorInfo : String
, disableErrorInfo : String
, twoFaActiveSince : String
, revert2FAText : String
, disableButton : String
, disableConfirmErrorMsg : String
, disableConfirmBoxInfo : String
, setupTwoFactorAuth : String
, setupTwoFactorAuthInfo : String
, activateButton : String
, setupConfirmLabel : String
, scanQRCode : String
, setupCodeInvalid : String
, ifNotQRCode : String
, reloadToTryAgain : String
, twoFactorNowActive : String
, revertInfo : String
}
gb : Texts
gb =
{ httpError = Messages.Comp.HttpError.gb
, formatDateShort = Messages.DateFormat.formatDateShort Messages.UiLanguage.English
, errorTitle = "Error"
, stateErrorInfoText = "There was a problem determining the current state of your two factor authentication scheme:"
, errorGeneratingQR = "Error generating QR Code"
, initErrorInfo = "There was an error when initializing two-factor authentication."
, confirmErrorInfo = "There was an error when confirming the setup!"
, disableErrorInfo = "There was an error when disabling 2FA!"
, twoFaActiveSince = "Two Factor Authentication is active since "
, revert2FAText = "If you really want to revert back to password-only authentication, you can do this here. You can run the setup any time to enable the second factor again."
, disableButton = "Disable 2FA"
, disableConfirmErrorMsg = "Please type OK if you really want to disable this!"
, disableConfirmBoxInfo = "Type `OK` into the text box and click the button to disable 2FA."
, setupTwoFactorAuth = "Setup Two Factor Authentication"
, setupTwoFactorAuthInfo = "You can setup a second factor for authentication using a one-time password. When clicking the button a secret is generated that you can load into an app on your mobile device. The app then provides a 6 digit code that you need to pass in the field in order to confirm and finalize the setup."
, activateButton = "Activate two-factor authentication"
, setupConfirmLabel = "Confirm"
, scanQRCode = "Scan this QR code with your device and enter the 6 digit code:"
, setupCodeInvalid = "The confirmation code was invalid!"
, ifNotQRCode = "If you cannot use the qr code, enter this secret:"
, reloadToTryAgain = "If you want to try again, reload the page."
, twoFactorNowActive = "Two Factor Authentication is now active!"
, revertInfo = "You can revert back to password-only auth any time (reload this page)."
}
de : Texts
de =
{ httpError = Messages.Comp.HttpError.de
, formatDateShort = Messages.DateFormat.formatDateShort Messages.UiLanguage.German
, errorTitle = "Fehler"
, stateErrorInfoText = "Es gab ein Problem, den Status der Zwei-Faktor-Authentifizierung zu ermittlen:"
, errorGeneratingQR = "Fehler beim Generieren des QR-Code"
, initErrorInfo = "Es gab ein Problem beim Initialisieren der Zwei-Faktor-Authentifizierung."
, confirmErrorInfo = "Es gab ein Problem bei der Verifizierung!"
, disableErrorInfo = "Es gab ein Problem die Zwei-Faktor-Authentifizierung zu entfernen."
, twoFaActiveSince = "Die Zwei-Faktor-Authentifizierung ist aktiv seit "
, revert2FAText = "Die Zwei-Faktor-Authentifizierung kann hier wieder deaktiviert werden. Danach kann die Einrichtung wieder von neuem gestartet werden, um 2FA wieder zu aktivieren."
, disableButton = "Deaktiviere 2FA"
, disableConfirmErrorMsg = "Bitte tippe OK ein, um die Zwei-Faktor-Authentifizierung zu deaktivieren."
, disableConfirmBoxInfo = "Tippe `OK` in das Feld und klicke, um die Zwei-Faktor-Authentifizierung zu deaktivieren."
, setupTwoFactorAuth = "Zwei-Faktor-Authentifizierung einrichten"
, setupTwoFactorAuthInfo = "Ein zweiter Faktor zur Authentifizierung mittels eines Einmalkennworts kann eingerichtet werden. Beim Klicken des Button wird ein Schlüssel generiert, der an eine Authentifizierungs-App eines mobilen Gerätes übetragen werden kann. Danach präsentiert die App ein 6-stelliges Kennwort, welches zur Bestätigung und zum Abschluss angegeben werden muss."
, activateButton = "Zwei-Faktor-Authentifizierung aktivieren"
, setupConfirmLabel = "Bestätigung"
, scanQRCode = "Scanne den QR Code mit der Authentifizierungs-App und gebe den 6-stelligen Code ein:"
, setupCodeInvalid = "Der Code war ungültig!"
, ifNotQRCode = "Wenn der QR-Code nicht möglich ist, kann der Schlüssel manuell eingegeben werden:"
, reloadToTryAgain = "Um es noch einmal zu versuchen, bitte die Seite neu laden."
, twoFactorNowActive = "Die Zwei-Faktor-Authentifizierung ist nun aktiv!"
, revertInfo = "Es kann jederzeit zur normalen Passwort-Authentifizierung zurück gegangen werden (dazu Seite neu laden)."
}

View File

@@ -15,6 +15,7 @@ import Messages.Comp.ChangePasswordForm
import Messages.Comp.EmailSettingsManage
import Messages.Comp.ImapSettingsManage
import Messages.Comp.NotificationManage
import Messages.Comp.OtpSetup
import Messages.Comp.ScanMailboxManage
import Messages.Comp.UiSettingsManage
@@ -26,6 +27,7 @@ type alias Texts =
, imapSettingsManage : Messages.Comp.ImapSettingsManage.Texts
, notificationManage : Messages.Comp.NotificationManage.Texts
, scanMailboxManage : Messages.Comp.ScanMailboxManage.Texts
, otpSetup : Messages.Comp.OtpSetup.Texts
, userSettings : String
, uiSettings : String
, notifications : String
@@ -38,6 +40,7 @@ type alias Texts =
, notificationRemindDaysInfo : String
, scanMailboxInfo1 : String
, scanMailboxInfo2 : String
, otpMenu : String
}
@@ -49,6 +52,7 @@ gb =
, imapSettingsManage = Messages.Comp.ImapSettingsManage.gb
, notificationManage = Messages.Comp.NotificationManage.gb
, scanMailboxManage = Messages.Comp.ScanMailboxManage.gb
, otpSetup = Messages.Comp.OtpSetup.gb
, userSettings = "User Settings"
, uiSettings = "UI Settings"
, notifications = "Notifications"
@@ -80,6 +84,7 @@ gb =
or to just leave it there. In the latter case you should
adjust the schedule to avoid reading over the same mails
again."""
, otpMenu = "Two Factor"
}
@@ -91,6 +96,7 @@ de =
, imapSettingsManage = Messages.Comp.ImapSettingsManage.de
, notificationManage = Messages.Comp.NotificationManage.de
, scanMailboxManage = Messages.Comp.ScanMailboxManage.de
, otpSetup = Messages.Comp.OtpSetup.de
, userSettings = "Benutzereinstellung"
, uiSettings = "Oberfläche"
, notifications = "Benachrichtigungen"
@@ -122,4 +128,5 @@ E-Mail-Einstellungen (IMAP) notwendig."""
ist es gut, die Kriterien so zu gestalten, dass die
gleichen E-Mails möglichst nicht noch einmal eingelesen
werden."""
, otpMenu = "Zwei Faktor Auth"
}