argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18k stars 5.48k forks source link

ArgoCD UI should redirect to the /login page when user not logged in #20874

Open narcistesa opened 1 day ago

narcistesa commented 1 day ago

Checklist:

Describe the bug

The ArgoCD UI replaces the browser history to navigate to /login?return_url=... without reloading the page. This behaviour is causing issues for us since we want to rewrite the /login location to /auth/login in our ingress controller. It would help immensely if the history.push was replaced by a window.location.href here: https://github.com/argoproj/argo-cd/blob/master/ui/src/app/app.tsx#L270

Not sure if this should be a feature request or a bug.

To Reproduce

Navigate to the / location of the ArgoCD UI and notice that the browser location has been updated to /login?return_url=... without a page reload. Checking the ingress controller logs shows that no calls were made to argocd-server.

Expected behavior

Ideally this should trigger a page reload to /login?return_url=... instead of just manipulating the browser history.

Screenshots

N/A

Version

~ ❯ argocd version
argocd: v2.13.1+af54ef8
  BuildDate: 2024-11-20T18:32:21Z
  GitCommit: af54ef8db5adfa77a08d4d05b1318a2198084c22
  GitTreeState: clean
  GoVersion: go1.23.3
  Compiler: gc
  Platform: darwin/arm64
argocd-server: v2.12.6+4dab5bd```

**Logs**

N/A