From af22bfdedc5e8c9a9a18d4d952885180ecb4168d Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Mon, 4 May 2026 19:49:49 +0900 Subject: [PATCH] appview/state: start auth flow when switching accounts If session has expired, start auth flow. Signed-off-by: Seongmin Lee --- appview/state/accounts.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/appview/state/accounts.go b/appview/state/accounts.go index 98dafefb..579b9dda 100644 --- a/appview/state/accounts.go +++ b/appview/state/accounts.go @@ -23,7 +23,13 @@ func (s *State) SwitchAccount(w http.ResponseWriter, r *http.Request) { if err := s.oauth.SwitchAccount(w, r, did); err != nil { l.Error("failed to switch account", "err", err) - s.pages.HxRedirect(w, "/login?error=session") + redirectURL, err := s.oauth.ClientApp.StartAuthFlow(r.Context(), did) + if err != nil { + l.Error("failed to resume login flow", "err", err) + s.pages.HxRedirect(w, "/login?error=session") + return + } + s.pages.HxRedirect(w, redirectURL) return } -- 2.51.2