Skip to content

Commit

Permalink
feat: add option to hide beta features
Browse files Browse the repository at this point in the history
  • Loading branch information
rdubigny committed Oct 22, 2024
1 parent 59d7d29 commit 8b1691b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
34 changes: 18 additions & 16 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,24 @@
<button id="logout">Se déconnecter</button>
</form>
<br>
<form action="/select-organization" method="post">
<button id="select-organization">Changer d’organisation</button>
</form>
<br>
<form action="/update-userinfo" method="post">
<button id="update-userinfo">Mettre à jour mes informations</button>
</form>
<br>
<form action="/force-login" method="post">
<button id="force-login">Forcer une reconnexion</button>
</form>
<br>
<form action="/force-2fa" method="post">
<button id="force-2fa">Forcer une connexion a deux facteurs</button>
</form>
<br>
<% if (locals.showBetaFeatures) { %>
<form action="/select-organization" method="post">
<button id="select-organization">Changer d’organisation</button>
</form>
<br>
<form action="/update-userinfo" method="post">
<button id="update-userinfo">Mettre à jour mes informations</button>
</form>
<br>
<form action="/force-login" method="post">
<button id="force-login">Forcer une reconnexion</button>
</form>
<br>
<form action="/force-2fa" method="post">
<button id="force-2fa">Forcer une connexion a deux facteurs</button>
</form>
<br>
<% } %>
<details>
<summary id="open-custom-configuration">Usage avancé</summary>

Expand Down

0 comments on commit 8b1691b

Please sign in to comment.