You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug : When SSO login is started twice within the same running process, the CLI crashes with a panic #549
Each SSO login now adds the /auth/callback route to its own private http.ServeMux instead of the global http.DefaultServeMux, so a second login no longer crashes. (PR: #571)
cmd/login.go:312 still calls http.HandleFunc("/auth/callback", callbackHandler) on the global http.DefaultServeMux. The test from this issue (two oauth2login calls in one process) panics:
panic: pattern "/auth/callback" (registered at cmd/login.go:312) conflicts with pattern "/auth/callback" (registered at cmd/login.go:312)
The earlier comment about a fix refers to PR #571, which was closed, so nothing has been merged. A private http.NewServeMux() per login, set as srv.Handler, would fix it. It would also cover #312, which has the same root cause.
Disclosure: this comment was drafted with AI assistance, and the results were run locally.
@aniket866 are you still working on this? If not, I can reopen #571. It's rebased on current master, and its test that runs two logins in one process passes. It would also fix #312.
Activity
Sarthak-Shreshtha01 commentedon Oct 4, 2026
Each SSO login now adds the /auth/callback route to its own private http.ServeMux instead of the global http.DefaultServeMux, so a second login no longer crashes. (PR: #571)
Sarthak-Shreshtha01 commentedon Oct 4, 2026
Sorry @aniket866, I missed that you had asked for this in the issue. I'm closing #571 so you can go ahead with yours.
yada commentedon Oct 15, 2026
Still valid on current master (f9550f5).
cmd/login.go:312still callshttp.HandleFunc("/auth/callback", callbackHandler)on the globalhttp.DefaultServeMux. The test from this issue (twooauth2logincalls in one process) panics:The earlier comment about a fix refers to PR #571, which was closed, so nothing has been merged. A private
http.NewServeMux()per login, set assrv.Handler, would fix it. It would also cover #312, which has the same root cause.Disclosure: this comment was drafted with AI assistance, and the results were run locally.
Sarthak-Shreshtha01 commentedon Oct 15, 2026
@aniket866 are you still working on this? If not, I can reopen #571. It's rebased on current master, and its test that runs two logins in one process passes. It would also fix #312.
aniket866 commentedon Oct 15, 2026
@Sarthak-Shreshtha01
yeah you can reopen No problem
Sarthak-Shreshtha01 commentedon Oct 15, 2026
Thanks @aniket866. I reopened #571 and rebased it on current master.