Monorepo for Tangled tangled.org

appview/{oauth,pages,state}: remove unused AddAccount session data #1020

open opened by boltless.me targeting master from sl/uvpzuszrulvq

idk why is this added. Seems like it isn't used?

Signed-off-by: Seongmin Lee git@boltless.me

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3mdcq5ouzcc22
+4 -11
Diff #2
+3 -7
appview/oauth/accounts.go
··· 127 127 } 128 128 129 129 type AuthReturnInfo struct { 130 - ReturnURL string 131 - AddAccount bool 130 + ReturnURL string 132 131 } 133 132 134 - func (o *OAuth) SetAuthReturn(w http.ResponseWriter, r *http.Request, returnURL string, addAccount bool) error { 133 + func (o *OAuth) SetAuthReturn(w http.ResponseWriter, r *http.Request, returnURL string) error { 135 134 session, err := o.SessStore.Get(r, AuthReturnName) 136 135 if err != nil { 137 136 return err 138 137 } 139 138 140 139 session.Values[AuthReturnURL] = returnURL 141 - session.Values[AuthAddAccount] = addAccount 142 140 session.Options.MaxAge = 60 * 30 143 141 session.Options.HttpOnly = true 144 142 session.Options.Secure = !o.Config.Core.Dev ··· 154 152 } 155 153 156 154 returnURL, _ := session.Values[AuthReturnURL].(string) 157 - addAccount, _ := session.Values[AuthAddAccount].(bool) 158 155 159 156 return &AuthReturnInfo{ 160 - ReturnURL: returnURL, 161 - AddAccount: addAccount, 157 + ReturnURL: returnURL, 162 158 } 163 159 } 164 160
-1
appview/oauth/consts.go
··· 5 5 AccountsName = "appview-accounts-v2" 6 6 AuthReturnName = "appview-auth-return" 7 7 AuthReturnURL = "return_url" 8 - AuthAddAccount = "add_account" 9 8 SessionHandle = "handle" 10 9 SessionDid = "did" 11 10 SessionId = "id"
-1
appview/pages/templates/user/login.html
··· 93 93 </span> 94 94 </div> 95 95 <input type="hidden" name="return_url" value="{{ .ReturnUrl }}"> 96 - <input type="hidden" name="add_account" value="{{ if .AddAccount }}true{{ end }}"> 97 96 98 97 <button 99 98 class="btn w-full my-2 mt-6 text-base "
+1 -2
appview/state/login.go
··· 27 27 case http.MethodPost: 28 28 handle := r.FormValue("handle") 29 29 returnURL := r.FormValue("return_url") 30 - addAccount := r.FormValue("add_account") == "true" 31 30 32 31 // when users copy their handle from bsky.app, it tends to have these characters around it: 33 32 // ··· 51 50 return 52 51 } 53 52 54 - if err := s.oauth.SetAuthReturn(w, r, returnURL, addAccount); err != nil { 53 + if err := s.oauth.SetAuthReturn(w, r, returnURL); err != nil { 55 54 l.Error("failed to set auth return", "err", err) 56 55 } 57 56

History

3 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/{oauth,pages,state}: remove unused AddAccount session data
2/3 failed, 1/3 success
expand
merge conflicts detected
expand
  • appview/pages/templates/user/login.html:33
  • appview/state/profile.go:817
  • appview/pages/templates/user/login.html:31
  • appview/pages/templates/user/login.html:93
expand 0 comments
1 commit
expand
appview/{oauth,pages,state}: remove unused AddAccount session data
1/3 failed, 2/3 success
expand
expand 0 comments
1 commit
expand
appview/{oauth,pages,state}: remove unused AddAccount session data
2/3 failed, 1/3 success
expand
expand 0 comments