-
-
Two-factor authentication
-
- An extra layer of security when logging in to your account.
-
+ <>
+
+
+
-
-
-
+
+ {auth.errorMessage != null && (
+
+ {auth.errorMessage}
+
+ )}
+
{is2FAActivation(auth.status) && (
)}
-
- {auth.errorMessage != null && (
-
- {auth.errorMessage}
-
- )}
-
+ >
);
});
diff --git a/app/assets/javascripts/preferences/panes/two-factor-auth/TwoFactorSuccess.tsx b/app/assets/javascripts/preferences/panes/two-factor-auth/TwoFactorSuccess.tsx
new file mode 100644
index 000000000..f2b5bd6e8
--- /dev/null
+++ b/app/assets/javascripts/preferences/panes/two-factor-auth/TwoFactorSuccess.tsx
@@ -0,0 +1,36 @@
+import { Button } from '@/components/Button';
+import ModalDialog, {
+ ModalDialogButtons,
+ ModalDialogDescription,
+ ModalDialogLabel,
+} from '@/components/shared/ModalDialog';
+import { Subtitle } from '@/preferences/components';
+import { observer } from 'mobx-react-lite';
+import { FunctionComponent } from 'preact';
+import { TwoFactorActivation } from './TwoFactorActivation';
+
+export const TwoFactorSuccess: FunctionComponent<{
+ activation: TwoFactorActivation;
+}> = observer(({ activation: act }) => (
+
+
+ Successfully Enabled
+
+
+
+
+ Two-factor authentication has been successfully enabled for your
+ account.
+
+
+
+
+
+
+
+));
diff --git a/app/assets/javascripts/preferences/panes/two-factor-auth/Verification.tsx b/app/assets/javascripts/preferences/panes/two-factor-auth/Verification.tsx
index 32f1978ae..7731bdbf8 100644
--- a/app/assets/javascripts/preferences/panes/two-factor-auth/Verification.tsx
+++ b/app/assets/javascripts/preferences/panes/two-factor-auth/Verification.tsx
@@ -2,51 +2,66 @@ import { Button } from '@/components/Button';
import { DecoratedInput } from '@/components/DecoratedInput';
import { observer } from 'mobx-react-lite';
import { FunctionComponent } from 'preact';
+import { Bullet } from './Bullet';
import { TwoFactorActivation } from './TwoFactorActivation';
import {
ModalDialog,
ModalDialogButtons,
ModalDialogDescription,
- ModalDialogLabel
+ ModalDialogLabel,
} from '@/components/shared/ModalDialog';
export const Verification: FunctionComponent<{
activation: TwoFactorActivation;
}> = observer(({ activation: act }) => {
- const borderInv =
- act.verificationStatus === 'invalid' ? 'border-dark-red' : '';
+ const secretKeyClass =
+ act.verificationStatus === 'invalid-secret' ? 'border-danger' : '';
+ const authTokenClass =
+ act.verificationStatus === 'invalid-auth-code' ? 'border-danger' : '';
return (
Step 3 of 3 - Verification
-
-
-
+
+
+
+
+
- ・Enter your secret key:
+ Enter your secret key:
+
-
+
+
+
+
- ・Verify the authentication code generated by your
+ Verify the authentication code generated by your
authenticator app:
+
- {act.verificationStatus === 'invalid' && (
-
- Incorrect credentials, please try again.
+ {act.verificationStatus === 'invalid-auth-code' && (
+
+ Incorrect authentication code, please try again.
+
+ )}
+ {act.verificationStatus === 'invalid-secret' && (
+
+ Incorrect secret key, please try again.
)}