From 9b3145e00c0155b42d4f3ded70cea723b0f879fb Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sun, 25 Jan 2026 20:43:07 +0900 Subject: [PATCH] appview/{oauth,pages,state}: remove unused `AddAccount` session data idk why was this added. Seems like it isn't used? Signed-off-by: Seongmin Lee --- appview/oauth/accounts.go | 10 +++------- appview/oauth/consts.go | 1 - appview/oauth/oauth.go | 2 +- appview/pages/templates/user/login.html | 1 - appview/state/login.go | 3 +-- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/appview/oauth/accounts.go b/appview/oauth/accounts.go index c8948bf1..87a963ac 100644 --- a/appview/oauth/accounts.go +++ b/appview/oauth/accounts.go @@ -127,18 +127,16 @@ func (o *OAuth) GetMultiAccountUser(r *http.Request) *MultiAccountUser { } type AuthReturnInfo struct { - ReturnURL string - AddAccount bool + ReturnURL string } -func (o *OAuth) SetAuthReturn(w http.ResponseWriter, r *http.Request, returnURL string, addAccount bool) error { +func (o *OAuth) SetAuthReturn(w http.ResponseWriter, r *http.Request, returnURL string) error { session, err := o.SessStore.Get(r, AuthReturnName) if err != nil { return err } session.Values[AuthReturnURL] = returnURL - session.Values[AuthAddAccount] = addAccount session.Options.MaxAge = 60 * 30 session.Options.HttpOnly = true session.Options.Secure = !o.Config.Core.Dev @@ -154,11 +152,9 @@ func (o *OAuth) GetAuthReturn(r *http.Request) *AuthReturnInfo { } returnURL, _ := session.Values[AuthReturnURL].(string) - addAccount, _ := session.Values[AuthAddAccount].(bool) return &AuthReturnInfo{ - ReturnURL: returnURL, - AddAccount: addAccount, + ReturnURL: returnURL, } } diff --git a/appview/oauth/consts.go b/appview/oauth/consts.go index 686c8499..e3a6be71 100644 --- a/appview/oauth/consts.go +++ b/appview/oauth/consts.go @@ -5,7 +5,6 @@ const ( AccountsName = "appview-accounts-v2" AuthReturnName = "appview-auth-return" AuthReturnURL = "return_url" - AuthAddAccount = "add_account" SessionHandle = "handle" SessionDid = "did" SessionId = "id" diff --git a/appview/oauth/oauth.go b/appview/oauth/oauth.go index 0cb715c7..a96469bc 100644 --- a/appview/oauth/oauth.go +++ b/appview/oauth/oauth.go @@ -396,7 +396,7 @@ func (o *OAuth) StartElevatedAuthFlow(ctx context.Context, w http.ResponseWriter info.AccountDID = &parsedDid o.ClientApp.Store.SaveAuthRequestInfo(ctx, *info) - if err := o.SetAuthReturn(w, r, returnURL, false); err != nil { + if err := o.SetAuthReturn(w, r, returnURL); err != nil { return "", fmt.Errorf("failed to set auth return: %w", err) } diff --git a/appview/pages/templates/user/login.html b/appview/pages/templates/user/login.html index cfd52098..0f439ff8 100644 --- a/appview/pages/templates/user/login.html +++ b/appview/pages/templates/user/login.html @@ -73,7 +73,6 @@ -