From 1614459dc4f0756200b386b767c1afa15fcc82ea Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sun, 25 Jan 2026 20:57:12 +0900 Subject: [PATCH] appview/oauth: remove `AuthReturnInfo` Signed-off-by: Seongmin Lee --- appview/oauth/accounts.go | 12 +++--------- appview/oauth/handler.go | 8 +++----- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/appview/oauth/accounts.go b/appview/oauth/accounts.go index 6403d7d9..83bf2ecc 100644 --- a/appview/oauth/accounts.go +++ b/appview/oauth/accounts.go @@ -126,10 +126,6 @@ func (o *OAuth) GetMultiAccountUser(r *http.Request) *MultiAccountUser { } } -type AuthReturnInfo struct { - ReturnURL string -} - func (o *OAuth) SetAuthReturn(w http.ResponseWriter, r *http.Request, returnURL string) error { session, err := o.SessStore.Get(r, AuthReturnName) if err != nil { @@ -145,17 +141,15 @@ func (o *OAuth) SetAuthReturn(w http.ResponseWriter, r *http.Request, returnURL return session.Save(r, w) } -func (o *OAuth) GetAuthReturn(r *http.Request) *AuthReturnInfo { +func (o *OAuth) GetAuthReturn(r *http.Request) string { session, err := o.SessStore.Get(r, AuthReturnName) if err != nil || session.IsNew { - return &AuthReturnInfo{} + return "" } returnURL, _ := session.Values[AuthReturnURL].(string) - return &AuthReturnInfo{ - ReturnURL: returnURL, - } + return returnURL } func (o *OAuth) ClearAuthReturn(w http.ResponseWriter, r *http.Request) error { diff --git a/appview/oauth/handler.go b/appview/oauth/handler.go index 5f23ac65..d77a8e8a 100644 --- a/appview/oauth/handler.go +++ b/appview/oauth/handler.go @@ -100,12 +100,10 @@ func (o *OAuth) callback(w http.ResponseWriter, r *http.Request) { } } - redirectURL := "/" - if authReturn.ReturnURL != "" { - redirectURL = authReturn.ReturnURL + if authReturn == "" { + authReturn = "/" } - - http.Redirect(w, r, redirectURL, http.StatusFound) + http.Redirect(w, r, authReturn, http.StatusFound) } func (o *OAuth) addToDefaultSpindle(did string) { -- 2.51.2