diff --git a/cypress/e2e/activate_totp/index.cy.ts b/cypress/e2e/activate_totp/index.cy.ts
index 69ef3f665..e363554e9 100644
--- a/cypress/e2e/activate_totp/index.cy.ts
+++ b/cypress/e2e/activate_totp/index.cy.ts
@@ -8,7 +8,7 @@ describe("add 2fa authentication", () => {
cy.contains("Double authentification");
- cy.get('[href="/double-authentication"]')
+ cy.get('[href="/double-authentication-choice"]')
.contains("Configurer la double authentification")
.click();
diff --git a/cypress/e2e/mfa_decision_helper_account/index.cy.ts b/cypress/e2e/mfa_decision_helper_account/index.cy.ts
index dd9e6e8ae..b00ca86f9 100644
--- a/cypress/e2e/mfa_decision_helper_account/index.cy.ts
+++ b/cypress/e2e/mfa_decision_helper_account/index.cy.ts
@@ -6,7 +6,7 @@ describe("mfa decision helper (account)", () => {
cy.login("lion.eljonson@darkangels.world");
- cy.get('[href="/double-authentication"]')
+ cy.get('[href="/double-authentication-choice"]')
.contains("Configurer la double authentification")
.click();
@@ -31,7 +31,7 @@ describe("mfa decision helper (account)", () => {
cy.login("lion.eljonson@darkangels.world");
- cy.get('[href="/double-authentication"]')
+ cy.get('[href="/double-authentication-choice"]')
.contains("Configurer la double authentification")
.click();
@@ -51,7 +51,7 @@ describe("mfa decision helper (account)", () => {
cy.login("lion.eljonson@darkangels.world");
- cy.get('[href="/double-authentication"]')
+ cy.get('[href="/double-authentication-choice"]')
.contains("Configurer la double authentification")
.click();
@@ -83,7 +83,7 @@ describe("mfa decision helper (account)", () => {
cy.login("lion.eljonson@darkangels.world");
- cy.get('[href="/double-authentication"]')
+ cy.get('[href="/double-authentication-choice"]')
.contains("Configurer la double authentification")
.click();
@@ -113,7 +113,7 @@ describe("mfa decision helper (account)", () => {
cy.login("lion.eljonson@darkangels.world");
- cy.get('[href="/double-authentication"]')
+ cy.get('[href="/double-authentication-choice"]')
.contains("Configurer la double authentification")
.click();
@@ -139,7 +139,7 @@ describe("mfa decision helper (account)", () => {
cy.login("lion.eljonson@darkangels.world");
- cy.get('[href="/double-authentication"]')
+ cy.get('[href="/double-authentication-choice"]')
.contains("Configurer la double authentification")
.click();
diff --git a/src/controllers/2fa.ts b/src/controllers/2fa.ts
index aabc90d7a..c5b2ebf5e 100644
--- a/src/controllers/2fa.ts
+++ b/src/controllers/2fa.ts
@@ -20,7 +20,7 @@ export const getDoubleAuthenticationController = async (
try {
const { id: user_id } = getUserFromAuthenticatedSession(req);
- return res.render("double-authentication", {
+ return res.render("double-authentication-choice", {
pageTitle: "Double authentification",
notifications: await getNotificationsFromRequest(req),
isAuthenticatorConfigured: await isTotpConfiguredForUser(user_id),
diff --git a/src/controllers/user/two-factors-authentication-configuration.ts b/src/controllers/user/two-factors-authentication-configuration.ts
index 9a70c5ff2..fdd7a6f5d 100644
--- a/src/controllers/user/two-factors-authentication-configuration.ts
+++ b/src/controllers/user/two-factors-authentication-configuration.ts
@@ -120,8 +120,12 @@ export const postTotpConfigurationController = async (
return res.redirect("/users/2fa-successfully-configured");
} catch (error) {
if (error instanceof InvalidTotpTokenError) {
+ const { "totp-tool-type": totpToolType } = req.body;
+ const totpToolTypeParam = totpToolType
+ ? `&totp-tool-type=${encodeURIComponent(totpToolType)}`
+ : "";
return res.redirect(
- "/users/totp-configuration?notification=invalid_totp_token",
+ `/users/totp-configuration?notification=invalid_totp_token${totpToolTypeParam}`,
);
}
diff --git a/src/routers/main.ts b/src/routers/main.ts
index 34b545faa..3224c5eb0 100644
--- a/src/routers/main.ts
+++ b/src/routers/main.ts
@@ -57,7 +57,7 @@ export const mainRouter = (app: Express) => {
);
mainRouter.get(
- "/double-authentication",
+ "/double-authentication-choice",
nocache(),
urlencoded({ extended: false }),
ejsLayoutMiddlewareFactory(app, true),
diff --git a/src/views/connection-and-account.ejs b/src/views/connection-and-account.ejs
index 4fc415e0c..076f2ab62 100644
--- a/src/views/connection-and-account.ejs
+++ b/src/views/connection-and-account.ejs
@@ -110,7 +110,7 @@
<% if (isAuthenticatorConfigured || passkeys.length > 0){ %>
Ajouter une méthode de validation supplémentaire
@@ -120,7 +120,7 @@
Vous n'avez pas encore configuré la double authentification (2FA).
-
+
Configurer la double authentification
<% } %>
diff --git a/src/views/double-authentication-choice.ejs b/src/views/double-authentication-choice.ejs
new file mode 100644
index 000000000..a3d8a1d25
--- /dev/null
+++ b/src/views/double-authentication-choice.ejs
@@ -0,0 +1,11 @@
+
+ <%- include('partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
+
+ <%- include('mfa-settings/double-authentication-choice-layout.ejs', {
+ withInfoAlert: false,
+ isTotpAppInstalledUrl: '/is-totp-app-installed',
+ verifyRegistrationAction: '/passkeys/verify-registration',
+ csrfToken: csrfToken,
+ }); %>
+
+
diff --git a/src/views/double-authentication.ejs b/src/views/double-authentication.ejs
deleted file mode 100644
index a1555aa0e..000000000
--- a/src/views/double-authentication.ejs
+++ /dev/null
@@ -1,71 +0,0 @@
-
- <%- include('partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
-
-
- Choisir votre méthode de connexion renforcée
-
-
-
- Impossible de créer une clé d’accès sur cet appareil
-
-
- Assurez-vous que le système d’exploitation de votre appareil est à jour,
- que le verrouillage de l’écran et le Bluetooth sont activés, et que vous
- utilisez un navigateur compatible.
-
-
-
-
- <%- include('partials/go-back.ejs'); %>
-
-
-
-
diff --git a/src/views/is-totp-app-installed.ejs b/src/views/is-totp-app-installed.ejs
index 440614f49..5e6a00a8f 100644
--- a/src/views/is-totp-app-installed.ejs
+++ b/src/views/is-totp-app-installed.ejs
@@ -1,73 +1,8 @@
- <%- include('partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
-
-
- <%- include('./partials/stepper.ejs', {currentStep: "1", stepsTitle: "Configurer votre outil TOTP", nextStepTitle:"Configurer votre application TOTP" }); %>
-
-
- <%- include('partials/go-back.ejs'); %>
-
+ <%- include('partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
+
+ <%- include('mfa-settings/is-totp-app-installed-layout.ejs', {
+ totpConfigurationUrl: '/totp-configuration',
+ }); %>
+
diff --git a/src/views/mfa-decision-helper/can-install-software/external-help-needed.ejs b/src/views/mfa-decision-helper/can-install-software/external-help-needed.ejs
index b219a3440..1b94c6aef 100644
--- a/src/views/mfa-decision-helper/can-install-software/external-help-needed.ejs
+++ b/src/views/mfa-decision-helper/can-install-software/external-help-needed.ejs
@@ -1,17 +1,6 @@
<%- include('../../partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
- <%- include('../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
-
-
-
Intervention extérieure nécessaire
-
-
-
- Nous n’avons pas de solution dans l’immédiat : contactez votre service
- informatique pour qu’ils vous fournissent des outils de 2FA.
-
- <%- include('../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../mfa-settings/external-help-needed-layout.ejs'); %>
diff --git a/src/views/mfa-decision-helper/can-install-software/index.ejs b/src/views/mfa-decision-helper/can-install-software/index.ejs
index a8e29f38d..73c43da71 100644
--- a/src/views/mfa-decision-helper/can-install-software/index.ejs
+++ b/src/views/mfa-decision-helper/can-install-software/index.ejs
@@ -1,51 +1,8 @@
<%- include('../../partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
-
- <%- include('../../partials/mfa-decision-helper-header.ejs', { step: "two" }); %>
-
-
- <%- include('../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../mfa-settings/can-install-software-layout.ejs', {
+ formAction: '/mfa-decision-helper/can-install-software',
+ }); %>
diff --git a/src/views/mfa-decision-helper/can-install-software/smartphone-app.ejs b/src/views/mfa-decision-helper/can-install-software/smartphone-app.ejs
index 360160080..1b738871b 100644
--- a/src/views/mfa-decision-helper/can-install-software/smartphone-app.ejs
+++ b/src/views/mfa-decision-helper/can-install-software/smartphone-app.ejs
@@ -1,19 +1,8 @@
<%- include('../../partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
- <%- include('../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
- <%- include('../totp-recommendation.ejs', {
- description: "Une application smartphone génère un code qui change toutes les 30 secondes.",
- toolTypeLabel: "l'application",
- tools: [
- { name: "Proton Authenticator", url: "https://proton.me/fr/authenticator/download", details: ["Application opensource."] },
- { name: "2FAS", url: "https://2fas.com/auth/", details: ["Application opensource."] },
- { name: "FreeOTP", url: "https://freeotp.github.io/", details: ["Application opensource."] },
- ]
- }) %>
-
- <%- include('../../partials/mfa-helper-restart.ejs'); %>
-
+ <%- include('../../mfa-settings/smartphone-app-layout.ejs', {
+ totpRecommendationPath: '../mfa-decision-helper/totp-recommendation.ejs',
+ }); %>
diff --git a/src/views/mfa-decision-helper/can-install-software/smartphone.ejs b/src/views/mfa-decision-helper/can-install-software/smartphone.ejs
index 755688bd1..9789fb89e 100644
--- a/src/views/mfa-decision-helper/can-install-software/smartphone.ejs
+++ b/src/views/mfa-decision-helper/can-install-software/smartphone.ejs
@@ -1,53 +1,8 @@
<%- include('../../partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
- <%- include('../../partials/mfa-decision-helper-header.ejs', { step: "two" }); %>
-
-
- <%- include('../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../mfa-settings/smartphone-layout.ejs', {
+ formAction: '/mfa-decision-helper/can-install-software/smartphone',
+ }); %>
diff --git a/src/views/mfa-decision-helper/can-install-software/software.ejs b/src/views/mfa-decision-helper/can-install-software/software.ejs
index 101591ce2..29a9bc3b2 100644
--- a/src/views/mfa-decision-helper/can-install-software/software.ejs
+++ b/src/views/mfa-decision-helper/can-install-software/software.ejs
@@ -1,17 +1,8 @@
<%- include('../../partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
- <%- include('../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
- <%- include('../totp-recommendation.ejs', {
- description: "Un logiciel ou une extension de navigateur génère un code qui change toutes les 30 secondes.",
- toolTypeLabel: "le logiciel",
- tools: [
- { name: "Proton Authenticator", url: "https://proton.me/fr/authenticator/download", details: ["Logiciel opensource sur Mac/Windows.", "Sans création de compte."] },
- { name: "Bitwarden", url: "https://bitwarden.com/fr-fr/download/", details: ["Extension de navigateur opensource.", "Nécessite une création de compte."] },
- { name: "KeePassXC", url: "https://keepassxc.org/download/#macos", details: ["Logiciel Mac/Windows avec plugin navigateur opensource.", "Sans création de compte."] },
- ]
- }) %>
- <%- include('../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../mfa-settings/software-layout.ejs', {
+ totpRecommendationPath: '../mfa-decision-helper/totp-recommendation.ejs',
+ }); %>
diff --git a/src/views/mfa-decision-helper/index.ejs b/src/views/mfa-decision-helper/index.ejs
index f2626772d..ea46d211c 100644
--- a/src/views/mfa-decision-helper/index.ejs
+++ b/src/views/mfa-decision-helper/index.ejs
@@ -1,69 +1,8 @@
<%- include('../partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
- <%- include('../partials/mfa-decision-helper-header.ejs', { step: "one" }); %>
-
-
- <%- include('../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../mfa-settings/index-layout.ejs', {
+ formAction: '/mfa-decision-helper',
+ }); %>
diff --git a/src/views/mfa-decision-helper/passkey.ejs b/src/views/mfa-decision-helper/passkey.ejs
index ad1e7ea4c..260d5a986 100644
--- a/src/views/mfa-decision-helper/passkey.ejs
+++ b/src/views/mfa-decision-helper/passkey.ejs
@@ -1,58 +1,10 @@
<%- include('../partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
- <%- include('../partials/notifications.ejs', {notifications: notifications}) %>
-
- <%- include('../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
-
-
- Impossible de créer une clé d’accès sur cet appareil
-
-
- Assurez-vous que le système d’exploitation de votre appareil est à jour,
- que le verrouillage de l’écran et le Bluetooth sont activés, et que vous
- utilisez un navigateur compatible.
-
-
-
-
-
-
- Recommandé pour vous
-
-
-
-
-
Passkey de votre ordinateur
-
-
- Le plus rapide et le plus simple : déverrouillez avec votre empreinte, votre visage ou le code PIN de votre ordinateur.
-
-
-
- Continuer avec la passkey
-
-
- <%- include('../partials/mfa-helper-restart.ejs'); %>
-
+ <%- include('../mfa-settings/passkey-layout.ejs', {
+ notifications: notifications,
+ csrfToken: csrfToken,
+ verifyRegistrationAction: '/passkeys/verify-registration',
+ }); %>
-
diff --git a/src/views/mfa-decision-helper/totp-recommendation.ejs b/src/views/mfa-decision-helper/totp-recommendation.ejs
index dd0e2cbd1..afecf67f5 100644
--- a/src/views/mfa-decision-helper/totp-recommendation.ejs
+++ b/src/views/mfa-decision-helper/totp-recommendation.ejs
@@ -1,33 +1,6 @@
-
- Recommandé pour vous
-
-
-
-
-
Codes à usage unique (TOTP)
-
-<%= description %>
-
- Vous êtes libre d'utiliser <%= toolTypeLabel %> de votre choix.
-
- Voici une liste <%= toolTypeLabel === "l'application" ? "d'applications" : "de logiciels" %>
- que vous pouvez utiliser si vous n'avez pas encore de solution installée :
-
-
-
-
- <% tools.forEach(function (tool) { %>
-
-
- <%= tool.name %>
-
- <% tool.details.forEach(function (detail) { %>
- <%= detail %>
- <% }); %>
-
- <% }); %>
-
-
-
- Continuer
-
+<%- include('../mfa-settings/totp-recommendation-layout.ejs', {
+ description: description,
+ toolTypeLabel: toolTypeLabel,
+ tools: tools,
+ isTotpAppInstalledUrl: '/is-totp-app-installed',
+}); %>
diff --git a/src/views/mfa-settings/can-install-software-layout.ejs b/src/views/mfa-settings/can-install-software-layout.ejs
new file mode 100644
index 000000000..8cdaf0d7b
--- /dev/null
+++ b/src/views/mfa-settings/can-install-software-layout.ejs
@@ -0,0 +1,46 @@
+<%- include('../partials/mfa-decision-helper-header.ejs', { step: "two" }); %>
+
+
+
+<%- include('../partials/mfa-helper-restart.ejs'); %>
diff --git a/src/views/mfa-settings/double-authentication-choice-layout.ejs b/src/views/mfa-settings/double-authentication-choice-layout.ejs
new file mode 100644
index 000000000..7ff70142e
--- /dev/null
+++ b/src/views/mfa-settings/double-authentication-choice-layout.ejs
@@ -0,0 +1,77 @@
+<% if (withInfoAlert) { %>
+
+
+ En plus du mot de passe, une étape de sécurité supplémentaire sera demandée à chaque nouvelle session sur <%= locals.spName ? locals.spName : "ce service" %>.
+
+
+<% } %>
+
+Choisir votre méthode de connexion renforcée
+
+
+
+ Impossible de créer une clé d’accès sur cet appareil
+
+
+ Assurez-vous que le système d’exploitation de votre appareil est à jour,
+ que le verrouillage de l’écran et le Bluetooth sont activés, et que vous
+ utilisez un navigateur compatible.
+
+
+
+
+
+
+
+<%- include('../partials/go-back.ejs'); %>
+
+
+
diff --git a/src/views/mfa-settings/external-help-needed-layout.ejs b/src/views/mfa-settings/external-help-needed-layout.ejs
new file mode 100644
index 000000000..b656417ea
--- /dev/null
+++ b/src/views/mfa-settings/external-help-needed-layout.ejs
@@ -0,0 +1,13 @@
+<%- include('../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
+
+
+
+
Intervention extérieure nécessaire
+
+
+
+ Nous n’avons pas de solution dans l’immédiat : contactez votre service
+ informatique pour qu’ils vous fournissent des outils de 2FA.
+
+
+<%- include('../partials/mfa-helper-restart.ejs'); %>
diff --git a/src/views/mfa-settings/index-layout.ejs b/src/views/mfa-settings/index-layout.ejs
new file mode 100644
index 000000000..ab90e5719
--- /dev/null
+++ b/src/views/mfa-settings/index-layout.ejs
@@ -0,0 +1,65 @@
+<%- include('../partials/mfa-decision-helper-header.ejs', { step: "one" }); %>
+
+
+
+<%- include('../partials/mfa-helper-restart.ejs'); %>
diff --git a/src/views/mfa-settings/is-totp-app-installed-layout.ejs b/src/views/mfa-settings/is-totp-app-installed-layout.ejs
new file mode 100644
index 000000000..2e3a57ad3
--- /dev/null
+++ b/src/views/mfa-settings/is-totp-app-installed-layout.ejs
@@ -0,0 +1,68 @@
+<%- include('../partials/stepper.ejs', {currentStep: "1", stepsTitle: "Configurer votre outil TOTP", nextStepTitle:"Configurer votre application TOTP" }); %>
+
+
+
+<%- include('../partials/go-back.ejs'); %>
diff --git a/src/views/mfa-settings/passkey-layout.ejs b/src/views/mfa-settings/passkey-layout.ejs
new file mode 100644
index 000000000..0367a3605
--- /dev/null
+++ b/src/views/mfa-settings/passkey-layout.ejs
@@ -0,0 +1,54 @@
+<%- include('../partials/notifications.ejs', {notifications: notifications}) %>
+
+<%- include('../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
+
+
+
+ Impossible de créer une clé d’accès sur cet appareil
+
+
+ Assurez-vous que le système d’exploitation de votre appareil est à jour,
+ que le verrouillage de l’écran et le Bluetooth sont activés, et que vous
+ utilisez un navigateur compatible.
+
+
+
+
+
+
+ Recommandé pour vous
+
+
+
+
+
Passkey de votre ordinateur
+
+
+ Le plus rapide et le plus simple : déverrouillez avec votre empreinte, votre visage ou le code PIN de votre ordinateur.
+
+
+
+ Continuer avec la passkey
+
+
+<%- include('../partials/mfa-helper-restart.ejs'); %>
+
+
+
diff --git a/src/views/mfa-settings/smartphone-app-layout.ejs b/src/views/mfa-settings/smartphone-app-layout.ejs
new file mode 100644
index 000000000..19eabc7b0
--- /dev/null
+++ b/src/views/mfa-settings/smartphone-app-layout.ejs
@@ -0,0 +1,13 @@
+<%- include('../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
+
+<%- include(totpRecommendationPath, {
+ description: "Une application smartphone génère un code qui change toutes les 30 secondes.",
+ toolTypeLabel: "l'application",
+ tools: [
+ { name: "Proton Authenticator", url: "https://proton.me/fr/authenticator/download", details: ["Application opensource."] },
+ { name: "2FAS", url: "https://2fas.com/auth/", details: ["Application opensource."] },
+ { name: "FreeOTP", url: "https://freeotp.github.io/", details: ["Application opensource."] },
+ ]
+}) %>
+
+<%- include('../partials/mfa-helper-restart.ejs'); %>
diff --git a/src/views/mfa-settings/smartphone-layout.ejs b/src/views/mfa-settings/smartphone-layout.ejs
new file mode 100644
index 000000000..cd8be79bc
--- /dev/null
+++ b/src/views/mfa-settings/smartphone-layout.ejs
@@ -0,0 +1,49 @@
+<%- include('../partials/mfa-decision-helper-header.ejs', { step: "two" }); %>
+
+
+
+<%- include('../partials/mfa-helper-restart.ejs'); %>
diff --git a/src/views/mfa-settings/software-layout.ejs b/src/views/mfa-settings/software-layout.ejs
new file mode 100644
index 000000000..a0d239105
--- /dev/null
+++ b/src/views/mfa-settings/software-layout.ejs
@@ -0,0 +1,13 @@
+<%- include('../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
+
+<%- include(totpRecommendationPath, {
+ description: "Un logiciel ou une extension de navigateur génère un code qui change toutes les 30 secondes.",
+ toolTypeLabel: "le logiciel",
+ tools: [
+ { name: "Proton Authenticator", url: "https://proton.me/fr/authenticator/download", details: ["Logiciel opensource sur Mac/Windows.", "Sans création de compte."] },
+ { name: "Bitwarden", url: "https://bitwarden.com/fr-fr/download/", details: ["Extension de navigateur opensource.", "Nécessite une création de compte."] },
+ { name: "KeePassXC", url: "https://keepassxc.org/download/#macos", details: ["Logiciel Mac/Windows avec plugin navigateur opensource.", "Sans création de compte."] },
+ ]
+}) %>
+
+<%- include('../partials/mfa-helper-restart.ejs'); %>
diff --git a/src/views/mfa-settings/totp-configuration-layout.ejs b/src/views/mfa-settings/totp-configuration-layout.ejs
new file mode 100644
index 000000000..4e2585625
--- /dev/null
+++ b/src/views/mfa-settings/totp-configuration-layout.ejs
@@ -0,0 +1,91 @@
+<%- include('../partials/notifications.ejs', {notifications: notifications}) %>
+<%- include('../partials/stepper.ejs', {currentStep: "2", stepsTitle: "Configurer votre application TOTP", nextStepTitle: nextStepTitle }); %>
+
+<% if (locals.isAuthenticatorAlreadyConfigured) { %>
+ Changer d’application d’authentification
+
+ Vous ne pourrez pas vous connecter à votre compte ProConnect avec votre ancienne
+ application d’authentification.
+
+<% } %>
+
+<% if (totpToolType === "smartphone") { %>
+ Scannez le QR Code avec votre smartphone
+<% } else { %>
+ Scannez le QR Code
+<% } %>
+
+
+
+
+
+
+ Vous ne pouvez pas scanner le code ?
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mfa-settings/totp-recommendation-layout.ejs b/src/views/mfa-settings/totp-recommendation-layout.ejs
new file mode 100644
index 000000000..056f18a0c
--- /dev/null
+++ b/src/views/mfa-settings/totp-recommendation-layout.ejs
@@ -0,0 +1,33 @@
+
+ Recommandé pour vous
+
+
+
+
+
Codes à usage unique (TOTP)
+
+<%= description %>
+
+ Vous êtes libre d'utiliser <%= toolTypeLabel %> de votre choix.
+
+ Voici une liste <%= toolTypeLabel === "l'application" ? "d'applications" : "de logiciels" %>
+ que vous pouvez utiliser si vous n'avez pas encore de solution installée :
+
+
+
+
+ <% tools.forEach(function (tool) { %>
+
+
+ <%= tool.name %>
+
+ <% tool.details.forEach(function (detail) { %>
+ <%= detail %>
+ <% }); %>
+
+ <% }); %>
+
+
+
+ Continuer
+
diff --git a/src/views/partials/mfa-helper-restart.ejs b/src/views/partials/mfa-helper-restart.ejs
index ef2647ba6..c828d2052 100644
--- a/src/views/partials/mfa-helper-restart.ejs
+++ b/src/views/partials/mfa-helper-restart.ejs
@@ -1,5 +1,8 @@
diff --git a/src/views/totp-configuration.ejs b/src/views/totp-configuration.ejs
index 407c95e4a..484534642 100644
--- a/src/views/totp-configuration.ejs
+++ b/src/views/totp-configuration.ejs
@@ -1,99 +1,10 @@
<%- include('partials/sidemenu.ejs', {activeLink: 'connection-and-account'}) %>
- <%- include('./partials/notifications.ejs', {notifications: notifications}) %>
- <%- include('./partials/stepper.ejs', {currentStep: "2", stepsTitle: "Configurer votre application TOTP", nextStepTitle:"Votre double authentification est bien configurée" }); %>
-
- <% if (isAuthenticatorAlreadyConfigured) { %>
-
Changer d’application d’authentification
-
- Vous ne pourrez pas vous connecter à votre compte ProConnect avec votre ancienne
- application d’authentification.
-
- <% } %>
-
- <% if (totpToolType === "smartphone") { %>
-
Scannez le QR Code avec votre smartphone
- <% } else { %>
-
Scannez le QR Code
- <% } %>
-
-
-
-
-
- Vous ne pouvez pas scanner le code ?
-
-
-
-
-
-
-
-
-
-
-
+ <%- include('mfa-settings/totp-configuration-layout.ejs', {
+ nextStepTitle: "Votre double authentification est bien configurée",
+ totpConfigurationUrl: '/totp-configuration',
+ cancelUrl: '/connection-and-account',
+ }); %>
diff --git a/src/views/user/double-authentication-choice.ejs b/src/views/user/double-authentication-choice.ejs
index e2deb4c91..093b6322f 100644
--- a/src/views/user/double-authentication-choice.ejs
+++ b/src/views/user/double-authentication-choice.ejs
@@ -1,76 +1,10 @@
<%- include('../partials/notifications.ejs', {notifications: notifications}) %>
-
-
-
- En plus du mot de passe, une étape de sécurité supplémentaire sera demandée à chaque nouvelle session sur <%= locals.spName ? locals.spName : "ce service" %>.
-
-
-
-
Choisir votre méthode de connexion renforcée
-
-
- Impossible de créer une clé d’accès sur cet appareil
-
-
- Assurez-vous que le système d’exploitation de votre appareil est à jour,
- que le verrouillage de l’écran et le Bluetooth sont activés, et que vous
- utilisez un navigateur compatible.
-
-
-
-
- <%- include('../partials/go-back.ejs'); %>
-
-
+ <%- include('../mfa-settings/double-authentication-choice-layout.ejs', {
+ withInfoAlert: true,
+ isTotpAppInstalledUrl: '/users/is-totp-app-installed',
+ verifyRegistrationAction: '/users/passkeys/verify-registration',
+ csrfToken: csrfToken,
+ }); %>
diff --git a/src/views/user/is-totp-app-installed.ejs b/src/views/user/is-totp-app-installed.ejs
index 7e57839bd..978395d3b 100644
--- a/src/views/user/is-totp-app-installed.ejs
+++ b/src/views/user/is-totp-app-installed.ejs
@@ -1,69 +1,5 @@
- <%- include('../partials/stepper.ejs', {currentStep: "1", stepsTitle: "Configurer votre outil TOTP", nextStepTitle:"Configurer votre application TOTP" }); %>
-
- <%- include('../partials/go-back.ejs'); %>
-
+ <%- include('../mfa-settings/is-totp-app-installed-layout.ejs', {
+ totpConfigurationUrl: '/users/totp-configuration',
+ }); %>
diff --git a/src/views/user/mfa-decision-helper/can-install-software/external-help-needed.ejs b/src/views/user/mfa-decision-helper/can-install-software/external-help-needed.ejs
index 9ae12a94c..d0f71bef0 100644
--- a/src/views/user/mfa-decision-helper/can-install-software/external-help-needed.ejs
+++ b/src/views/user/mfa-decision-helper/can-install-software/external-help-needed.ejs
@@ -1,15 +1,3 @@
- <%- include('../../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
-
-
-
Intervention extérieure nécessaire
-
-
-
- Nous n’avons pas de solution dans l’immédiat : contactez votre service
- informatique pour qu’ils vous fournissent des outils de 2FA.
-
-
- <%- include('../../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../../mfa-settings/external-help-needed-layout.ejs'); %>
diff --git a/src/views/user/mfa-decision-helper/can-install-software/index.ejs b/src/views/user/mfa-decision-helper/can-install-software/index.ejs
index e8bd715ed..17119cc4c 100644
--- a/src/views/user/mfa-decision-helper/can-install-software/index.ejs
+++ b/src/views/user/mfa-decision-helper/can-install-software/index.ejs
@@ -1,47 +1,5 @@
- <%- include('../../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
-
- <%- include('../../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../../mfa-settings/can-install-software-layout.ejs', {
+ formAction: '/users/mfa-decision-helper/can-install-software',
+ }); %>
diff --git a/src/views/user/mfa-decision-helper/can-install-software/smartphone-app.ejs b/src/views/user/mfa-decision-helper/can-install-software/smartphone-app.ejs
index de8424262..84afc6e86 100644
--- a/src/views/user/mfa-decision-helper/can-install-software/smartphone-app.ejs
+++ b/src/views/user/mfa-decision-helper/can-install-software/smartphone-app.ejs
@@ -1,15 +1,5 @@
- <%- include('../../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
- <%- include('../totp-recommendation.ejs', {
- description: "Une application smartphone génère un code qui change toutes les 30 secondes.",
- toolTypeLabel: "l'application",
- tools: [
- { name: "Proton Authenticator", url: "https://proton.me/fr/authenticator/download", details: ["Application opensource."] },
- { name: "2FAS", url: "https://2fas.com/auth/", details: ["Application opensource."] },
- { name: "FreeOTP", url: "https://freeotp.github.io/", details: ["Application opensource."] },
- ]
- }) %>
-
- <%- include('../../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../../mfa-settings/smartphone-app-layout.ejs', {
+ totpRecommendationPath: '../user/mfa-decision-helper/totp-recommendation.ejs',
+ }); %>
diff --git a/src/views/user/mfa-decision-helper/can-install-software/smartphone.ejs b/src/views/user/mfa-decision-helper/can-install-software/smartphone.ejs
index ad536ee85..118c1a06b 100644
--- a/src/views/user/mfa-decision-helper/can-install-software/smartphone.ejs
+++ b/src/views/user/mfa-decision-helper/can-install-software/smartphone.ejs
@@ -1,55 +1,5 @@
- <%- include('../../../partials/mfa-decision-helper-header.ejs', { step: "two" }); %>
-
-
-
- <%- include('../../../partials/mfa-helper-restart.ejs'); %>
-
+ <%- include('../../../mfa-settings/smartphone-layout.ejs', {
+ formAction: '/users/mfa-decision-helper/can-install-software/smartphone',
+ }); %>
diff --git a/src/views/user/mfa-decision-helper/can-install-software/software.ejs b/src/views/user/mfa-decision-helper/can-install-software/software.ejs
index d0f2086c2..889a5815e 100644
--- a/src/views/user/mfa-decision-helper/can-install-software/software.ejs
+++ b/src/views/user/mfa-decision-helper/can-install-software/software.ejs
@@ -1,15 +1,5 @@
- <%- include('../../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
- <%- include('../totp-recommendation.ejs', {
- description: "Un logiciel ou une extension de navigateur génère un code qui change toutes les 30 secondes.",
- toolTypeLabel: "le logiciel",
- tools: [
- { name: "Proton Authenticator", url: "https://proton.me/fr/authenticator/download", details: ["Logiciel opensource sur Mac/Windows.", "Sans création de compte."] },
- { name: "Bitwarden", url: "https://bitwarden.com/fr-fr/download/", details: ["Extension de navigateur opensource.", "Nécessite une création de compte."] },
- { name: "KeePassXC", url: "https://keepassxc.org/download/#macos", details: ["Logiciel Mac/Windows avec plugin navigateur opensource.", "Sans création de compte."] },
- ]
- }) %>
-
- <%- include('../../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../../mfa-settings/software-layout.ejs', {
+ totpRecommendationPath: '../user/mfa-decision-helper/totp-recommendation.ejs',
+ }); %>
diff --git a/src/views/user/mfa-decision-helper/index.ejs b/src/views/user/mfa-decision-helper/index.ejs
index 3eb108ffe..28ac5c82e 100644
--- a/src/views/user/mfa-decision-helper/index.ejs
+++ b/src/views/user/mfa-decision-helper/index.ejs
@@ -1,67 +1,5 @@
- <%- include('../../partials/mfa-decision-helper-header.ejs', { step: "one" }); %>
-
-
-
- <%- include('../../partials/mfa-helper-restart.ejs'); %>
+ <%- include('../../mfa-settings/index-layout.ejs', {
+ formAction: '/users/mfa-decision-helper',
+ }); %>
diff --git a/src/views/user/mfa-decision-helper/passkey.ejs b/src/views/user/mfa-decision-helper/passkey.ejs
index aaba385a6..2a7119d6e 100644
--- a/src/views/user/mfa-decision-helper/passkey.ejs
+++ b/src/views/user/mfa-decision-helper/passkey.ejs
@@ -1,56 +1,7 @@
- <%- include('../../partials/notifications.ejs', {notifications: notifications}) %>
-
- <%- include('../../partials/mfa-decision-helper-header.ejs', { step: "three" }); %>
-
-
-
- Impossible de créer une clé d’accès sur cet appareil
-
-
- Assurez-vous que le système d’exploitation de votre appareil est à jour,
- que le verrouillage de l’écran et le Bluetooth sont activés, et que vous
- utilisez un navigateur compatible.
-
-
-
-
-
-
- Recommandé pour vous
-
-
-
-
-
Passkey de votre ordinateur
-
-
- Le plus rapide et le plus simple : déverrouillez avec votre empreinte, votre visage ou le code PIN de votre ordinateur.
-
-
-
- Continuer avec la passkey
-
-
- <%- include('../../partials/mfa-helper-restart.ejs'); %>
-
-
-
+ <%- include('../../mfa-settings/passkey-layout.ejs', {
+ notifications: notifications,
+ csrfToken: csrfToken,
+ verifyRegistrationAction: '/users/passkeys/verify-registration',
+ }); %>
diff --git a/src/views/user/mfa-decision-helper/totp-recommendation.ejs b/src/views/user/mfa-decision-helper/totp-recommendation.ejs
index f0fe33d71..aa832c937 100644
--- a/src/views/user/mfa-decision-helper/totp-recommendation.ejs
+++ b/src/views/user/mfa-decision-helper/totp-recommendation.ejs
@@ -1,33 +1,6 @@
-
- Recommandé pour vous
-
-
-
-
-
Codes à usage unique (TOTP)
-
-<%= description %>
-
- Vous êtes libre d'utiliser <%= toolTypeLabel %> de votre choix.
-
- Voici une liste <%= toolTypeLabel === "l'application" ? "d'applications" : "de logiciels" %>
- que vous pouvez utiliser si vous n'avez pas encore de solution installée :
-
-
-
-
- <% tools.forEach(function (tool) { %>
-
-
- <%= tool.name %>
-
- <% tool.details.forEach(function (detail) { %>
- <%= detail %>
- <% }); %>
-
- <% }); %>
-
-
-
- Continuer
-
+<%- include('../../mfa-settings/totp-recommendation-layout.ejs', {
+ description: description,
+ toolTypeLabel: toolTypeLabel,
+ tools: tools,
+ isTotpAppInstalledUrl: '/users/is-totp-app-installed',
+}); %>
diff --git a/src/views/user/totp-configuration.ejs b/src/views/user/totp-configuration.ejs
index 88656bd16..886ef8a03 100644
--- a/src/views/user/totp-configuration.ejs
+++ b/src/views/user/totp-configuration.ejs
@@ -1,89 +1,7 @@
- <%- include('../partials/notifications.ejs', {notifications: notifications}) %>
- <%- include('../partials/stepper.ejs', {currentStep: "2", stepsTitle: "Configurer votre application TOTP", nextStepTitle:"Vous pouvez dès à présent vous ProConnecter" }); %>
-
- <% if (totpToolType === "smartphone") { %>
-
Scannez le QR Code avec votre smartphone
- <% } else { %>
-
Scannez le QR Code
- <% } %>
-
-
-
-
-
-
- Vous ne pouvez pas scanner le code ?
-
-
-
-
-
-
-
-
-
-
-
-
+ <%- include('../mfa-settings/totp-configuration-layout.ejs', {
+ nextStepTitle: "Vous pouvez dès à présent vous ProConnecter",
+ totpConfigurationUrl: '/users/totp-configuration',
+ cancelUrl: '/users/double-authentication-choice',
+ }); %>