Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/script/routes/passport-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ export class PassportAuthentication {

router.get("/auth/login", this._cookieSessionMiddleware, (req: Request, res: Response): any => {
req.session["hostname"] = req.query.hostname;
res.render("authenticate", { action: "login" });
res.render("authenticate", { action: "login", isGitHubAuthenticationEnabled, isMicrosoftAuthenticationEnabled });
});

router.get("/auth/link", this._cookieSessionMiddleware, (req: Request, res: Response): any => {
req.session["authorization"] = req.query.access_token;
res.render("authenticate", { action: "link" });
res.render("authenticate", { action: "link", isGitHubAuthenticationEnabled, isMicrosoftAuthenticationEnabled });
});

router.get("/auth/register", this._cookieSessionMiddleware, (req: Request, res: Response): any => {
req.session["hostname"] = req.query.hostname;
res.render("authenticate", { action: "register" });
res.render("authenticate", { action: "register", isGitHubAuthenticationEnabled, isMicrosoftAuthenticationEnabled });
});

return router;
Expand Down
14 changes: 9 additions & 5 deletions api/script/views/authenticate.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@
<div class="container">
Please select an authentication provider for your CodePush account:<br />
<br />
<a href="/auth/<%=action%>/github"><img class="github" src="images/GitHub.png"> GitHub</a>
<span class="spacer"/>
<a href="/auth/<%=action%>/microsoft"><img class="microsoft" src="images/windows10.png"> Microsoft (Personal)</a>
<span class="spacer"/>
<a href="/auth/<%=action%>/azure-ad"><img class="microsoft" src="images/windows10.png"> Microsoft (Work)</a><br />
<% if (isGitHubAuthenticationEnabled) { %>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to hide authentication if it is not available.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to hide authentication if it is not available.

So, a broken button is better ? 🙃

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I misunderstood the change. Thank you.

<a href="/auth/<%=action%>/github"><img class="github" src="images/GitHub.png"> GitHub</a>
<span class="spacer"/>
<% } %>
<% if (isMicrosoftAuthenticationEnabled) { %>
<a href="/auth/<%=action%>/microsoft"><img class="microsoft" src="images/windows10.png"> Microsoft (Personal)</a>
<span class="spacer"/>
<a href="/auth/<%=action%>/azure-ad"><img class="microsoft" src="images/windows10.png"> Microsoft (Work)</a><br />
<% } %>
</div>
</body>
</html>