Skip to content

Commit

Permalink
fix: broken MonComptePro button on test.moncomptepro.beta.gouv.fr
Browse files Browse the repository at this point in the history
  • Loading branch information
rdubigny committed Oct 4, 2024
1 parent 013417c commit 116d636
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 34 deletions.
4 changes: 2 additions & 2 deletions e2e/features/connexion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Given("je navigue sur la page", () => {
cy.visit("/");
});

When("je clique sur le bouton MonComptePro", () => {
cy.get(".moncomptepro-button").click();
When("je clique sur le bouton ProConnect", () => {
cy.get(".proconnect-button").click();
});

When("je suis redirigé sur {string}", (path: string) => {
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ app.get("/", async (req, res, next) => {
userinfo: JSON.stringify(req.session.userinfo, null, 2),
idtoken: JSON.stringify(req.session.idtoken, null, 2),
oauth2token: JSON.stringify(req.session.oauth2token, null, 2),
showAgentConnectButton: process.env.SHOW_AGENTCONNECT_BUTTON === "true",
});
} catch (e) {
next(e);
Expand Down
48 changes: 17 additions & 31 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,23 @@
<main>
<h1><%= locals.title %></h1>
<h2>Se connecter</h2>
<% if (locals.showAgentConnectButton === true) { %>
<div>
<form action="/login" method="post">
<button class="proconnect-button">
<span class="proconnect-sr-only">S’identifier avec ProConnect</span>
</button>
</form>
<p>
<a
href="https://www.proconnect.gouv.fr/"
target="_blank"
rel="noopener noreferrer"
title="Qu’est-ce que ProConnect ? - nouvelle fenêtre"
>
Qu’est-ce que ProConnect ?
</a>
</p>
</div>
<% } else { %>
<div>
<form action="/login" method="post">
<button id="login" class="moncomptepro-button" aria-label="S'identifier avec MonComptePro"></button>
</form>
<p>
<a href="https://moncomptepro.beta.gouv.fr/" target="_blank" rel="noopener noreferrer"
title="Qu’est-ce que MonComptePro ? - nouvelle fenêtre">
Qu’est-ce que MonComptePro ?
</a>
</p>
</div>
<% } %>
<div>
<form action="/login" method="post">
<button class="proconnect-button">
<span class="proconnect-sr-only">S’identifier avec ProConnect</span>
</button>
</form>
<p>
<a
href="https://www.proconnect.gouv.fr/"
target="_blank"
rel="noopener noreferrer"
title="Qu’est-ce que ProConnect ? - nouvelle fenêtre"
>
Qu’est-ce que ProConnect ?
</a>
</p>
</div>
<% if (locals.userinfo) { %>
<h2>Information utilisateur</h2>
<pre><code><%= locals.userinfo %></code></pre>
Expand Down

0 comments on commit 116d636

Please sign in to comment.