From 8b1691bbc50734eb286dcce251f6f310f05c5aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Dubigny?= Date: Tue, 22 Oct 2024 17:14:32 +0200 Subject: [PATCH] feat: add option to hide beta features --- .env | 1 + index.js | 1 + views/index.ejs | 34 ++++++++++++++++++---------------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.env b/.env index 34d4176..7b9286a 100644 --- a/.env +++ b/.env @@ -13,3 +13,4 @@ MCP_USERINFO_SIGNED_RESPONSE_ALG: "" ACR_VALUES: "" SESSION_SECRET: CeciEstUnFauxSecret ACR_VALUE_FOR_2FA: "https://proconnect.gouv.fr/assurance/consistency-checked-2fa" +SHOW_BETA_FEATURES: True diff --git a/index.js b/index.js index 75155c8..cb3e21d 100644 --- a/index.js +++ b/index.js @@ -65,6 +65,7 @@ app.get("/", async (req, res, next) => { idtoken: JSON.stringify(req.session.idtoken, null, 2), oauth2token: JSON.stringify(req.session.oauth2token, null, 2), defaultParamsValue: JSON.stringify(AUTHORIZATION_DEFAULT_PARAMS, null, 2), + showBetaFeatures: process.env.SHOW_BETA_FEATURES === "True", }); } catch (e) { next(e); diff --git a/views/index.ejs b/views/index.ejs index 8a21f86..d62357f 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -71,22 +71,24 @@
-
- -
-
-
- -
-
-
- -
-
-
- -
-
+ <% if (locals.showBetaFeatures) { %> +
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+ <% } %>
Usage avancé