Skip to content

fix(ui):ArgoCD Login Link Displays Layouts Before Login Page#25463

Open
aali309 wants to merge 7 commits intoargoproj:masterfrom
aali309:loginUI
Open

fix(ui):ArgoCD Login Link Displays Layouts Before Login Page#25463
aali309 wants to merge 7 commits intoargoproj:masterfrom
aali309:loginUI

Conversation

@aali309
Copy link
Copy Markdown
Contributor

@aali309 aali309 commented Dec 1, 2025

When the ArgoCD login link is launched, the initial view does not directly display the login page. Instead, it shows various layouts, ArgoCD versions, and tabs before finally loading the login page. This behaviour may lead to confusion for users expecting an immediate login prompt.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@bunnyshell
Copy link
Copy Markdown

bunnyshell bot commented Dec 1, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@aali309 aali309 marked this pull request as ready for review December 1, 2025 20:07
@aali309 aali309 requested a review from a team as a code owner December 1, 2025 20:07
Copy link
Copy Markdown
Member

@anandf anandf left a comment

Choose a reason for hiding this comment

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

Thanks @aali309 for this PR. Provided few minor comments.

@aali309 aali309 force-pushed the loginUI branch 2 times, most recently from 0495ce5 to e0aae7c Compare December 2, 2025 23:41
@aali309
Copy link
Copy Markdown
Contributor Author

aali309 commented Dec 2, 2025

Thanks @aali309 for this PR. Provided few minor comments.

Thnx @anandf

Copy link
Copy Markdown
Member

@anandf anandf left a comment

Choose a reason for hiding this comment

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

LGTM

if (iss && iss !== 'argocd') {
return ((authSettings.dexConfig && authSettings.dexConfig.connectors) || []).length > 0 || authSettings.oidcConfig;
// Combine both async calls into one Promise.all for better performance
const [userInfo, authSettings] = await Promise.all([services.users.get(), services.authService.settings()]);
Copy link
Copy Markdown
Contributor

@keithchong keithchong Jan 14, 2026

Choose a reason for hiding this comment

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

This change is not part of the actual fix, right (on its own that is)? Also there seems to be duplicate code here and in the new protected-route component, it can apply the same logic?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

reverted this and extracted the code into shared function that both files can reuse.

@aali309 aali309 force-pushed the loginUI branch 2 times, most recently from 642c3c4 to fd880f6 Compare January 15, 2026 22:22
@aali309 aali309 force-pushed the loginUI branch 2 times, most recently from 7452ce5 to 05da4de Compare March 30, 2026 15:57
// Check SSO configuration if user is not logged in
const hasSSO = isSSOConfigured(userInfo, authSettings);

return {loggedIn: false, isSSO: hasSSO};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If SSO is not configured, then should we be returning loggedIn as false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. If they’re not logged in, we always use loggedIn: false. isSSO only picks SSO redirect vs the normal login page. It doesn’t mean they’re logged in. So when SSO isn’t set up, we still return loggedIn: false and isSSO: false.

appContext.navigation.goto('.', {sso_error: null});

await services.users.login(username, password);
setLoginInProgress(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we ensure setLogInProgress is set to false below, in a finally ?

} catch (e) {
setLoginError(e.response.body.error);

window.location.replace(basehref + redirectPath);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you use appContext.navigation.goto here instead?

aali309 added 3 commits April 7, 2026 14:45
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
aali309 added 4 commits April 7, 2026 14:46
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
…uses

Signed-off-by: Atif Ali <atali@redhat.com>
return (
<DataLoader input={cacheKey} load={checkAuthState}>
{({loggedIn, isSSO}) => {
if (loggedIn) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Regarding my comment at line 31, or maybe the change should be here instead.

If SSO is not enabled, then loggedIn is false, so we always present the login page. Should it be instead, if and only if SSO is enabled, then we prompt to log in if loggedIn is false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this would be wrong? Because even if SSO is not enabled, users still must see /login i.e (local accounts).
The flow currently is:
When loggedIn is false, we always send users to a login flow. isSSO only chooses how: if SSO is set up for the redirect path we use /auth/login, otherwise we Redirect to /login. Local-only installs still need the /login page, so we can’t gate “prompt for login” on SSO being enabled only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i.e we should not be skipping login because SSO is not enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants