Monorepo for Tangled tangled.org

appview: remove oauth.User type #1027

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

This is not required anymore. MultiAccountUser can just hold active user DID.

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/3mdcq5ouzmj22
+14 -14
Interdiff #3 #4
appview/issues/issues.go

This file has not been changed.

appview/knots/knots.go

This file has not been changed.

appview/labels/labels.go

This file has not been changed.

appview/middleware/middleware.go

This file has not been changed.

appview/notifications/notifications.go

This file has not been changed.

appview/oauth/accounts.go

This file has not been changed.

appview/oauth/oauth.go

This file has not been changed.

appview/pulls/pulls.go

This file has not been changed.

appview/repo/artifact.go

This file has not been changed.

appview/repo/repo.go

This patch was likely rebased, as context lines do not match.

appview/repo/settings.go

This patch was likely rebased, as context lines do not match.

appview/reporesolver/resolver.go

This file has not been changed.

+14 -14
appview/settings/settings.go
··· 70 70 func (s *Settings) profileSettings(w http.ResponseWriter, r *http.Request) { 71 71 user := s.OAuth.GetMultiAccountUser(r) 72 72 73 - punchcardPreferences, err := db.GetPunchcardPreference(s.Db, user.Did) 73 + punchcardPreferences, err := db.GetPunchcardPreference(s.Db, user.Did()) 74 74 if err != nil { 75 75 log.Printf("failed to get users punchcard preferences: %s", err) 76 76 } ··· 84 84 func (s *Settings) sitesSettings(w http.ResponseWriter, r *http.Request) { 85 85 user := s.OAuth.GetMultiAccountUser(r) 86 86 87 - claim, err := db.GetActiveDomainClaimForDid(s.Db, user.Active.Did) 87 + claim, err := db.GetActiveDomainClaimForDid(s.Db, user.Did) 88 88 if err != nil { 89 89 s.Logger.Error("failed to get domain claim", "err", err) 90 90 claim = nil ··· 93 93 // determine whether the active account has a tngl.sh handle, in which 94 94 // case their sites domain is automatically their handle domain. 95 95 isTnglHandle := func() bool { 96 - ident, err := s.IdResolver.ResolveIdent(r.Context(), user.Active.Did) 96 + ident, err := s.IdResolver.ResolveIdent(r.Context(), user.Did) 97 97 if err != nil { 98 98 return false 99 99 } ··· 127 127 128 128 func (s *Settings) keysSettings(w http.ResponseWriter, r *http.Request) { 129 129 user := s.OAuth.GetMultiAccountUser(r) 130 - pubKeys, err := db.GetPublicKeysForDid(s.Db, user.Did) 130 + pubKeys, err := db.GetPublicKeysForDid(s.Db, user.Active.Did) 131 131 if err != nil { 132 132 log.Println(err) 133 133 } ··· 140 140 141 141 func (s *Settings) emailsSettings(w http.ResponseWriter, r *http.Request) { 142 142 user := s.OAuth.GetMultiAccountUser(r) 143 - emails, err := db.GetAllEmails(s.Db, user.Did) 143 + emails, err := db.GetAllEmails(s.Db, user.Active.Did) 144 144 if err != nil { 145 145 log.Println(err) 146 146 } ··· 164 164 } 165 165 166 166 isTnglHandle := func() bool { 167 - ident, err := s.IdResolver.ResolveIdent(r.Context(), user.Active.Did) 167 + ident, err := s.IdResolver.ResolveIdent(r.Context(), user.Did) 168 168 if err != nil { 169 169 return false 170 170 } ··· 175 175 return 176 176 } 177 177 178 - if err := db.ReleaseDomain(s.Db, user.Active.Did, domain); err != nil { 178 + if err := db.ReleaseDomain(s.Db, user.Did, domain); err != nil { 179 179 s.Logger.Error("releasing domain", "err", err) 180 180 s.Pages.Notice(w, "settings-sites-error", "Unable to release domain. Make sure it belongs to your account.") 181 181 return ··· 183 183 184 184 // Clean up all site data for this DID asynchronously. 185 185 if s.CfClient.Enabled() { 186 - siteConfigs, err := db.GetRepoSiteConfigsForDid(s.Db, user.Active.Did) 186 + siteConfigs, err := db.GetRepoSiteConfigsForDid(s.Db, user.Did) 187 187 if err != nil { 188 188 s.Logger.Error("releaseSitesDomain: fetching site configs for cleanup", "err", err) 189 189 } 190 190 191 - if err := db.DeleteRepoSiteConfigsForDid(s.Db, user.Active.Did); err != nil { 191 + if err := db.DeleteRepoSiteConfigsForDid(s.Db, user.Did); err != nil { 192 192 s.Logger.Error("releaseSitesDomain: deleting site configs from db", "err", err) 193 193 } 194 194 ··· 197 197 198 198 // Delete each repo's R2 objects. 199 199 for _, sc := range siteConfigs { 200 - if err := sites.Delete(ctx, s.CfClient, user.Active.Did, sc.RepoName); err != nil { 201 - s.Logger.Error("releaseSitesDomain: R2 delete failed", "did", user.Active.Did, "repo", sc.RepoName, "err", err) 200 + if err := sites.Delete(ctx, s.CfClient, user.Did, sc.RepoName); err != nil { 201 + s.Logger.Error("releaseSitesDomain: R2 delete failed", "did", user.Did, "repo", sc.RepoName, "err", err) 202 202 } 203 203 } 204 204 ··· 232 232 func (s *Settings) profileSettings(w http.ResponseWriter, r *http.Request) { 233 233 user := s.OAuth.GetMultiAccountUser(r) 234 234 235 - punchcardPreferences, err := db.GetPunchcardPreference(s.Db, user.Did()) 235 + punchcardPreferences, err := db.GetPunchcardPreference(s.Db, user.Did) 236 236 if err != nil { 237 237 log.Printf("failed to get users punchcard preferences: %s", err) 238 238 } ··· 289 289 290 290 func (s *Settings) keysSettings(w http.ResponseWriter, r *http.Request) { 291 291 user := s.OAuth.GetMultiAccountUser(r) 292 - pubKeys, err := db.GetPublicKeysForDid(s.Db, user.Active.Did) 292 + pubKeys, err := db.GetPublicKeysForDid(s.Db, user.Did) 293 293 if err != nil { 294 294 s.Logger.Error("keys settings", "err", err) 295 295 } ··· 302 302 303 303 func (s *Settings) emailsSettings(w http.ResponseWriter, r *http.Request) { 304 304 user := s.OAuth.GetMultiAccountUser(r) 305 - emails, err := db.GetAllEmails(s.Db, user.Active.Did) 305 + emails, err := db.GetAllEmails(s.Db, user.Did) 306 306 if err != nil { 307 307 s.Logger.Error("emails settings", "err", err) 308 308 }
appview/spindles/spindles.go

This file has not been changed.

appview/state/accounts.go

This file has not been changed.

appview/state/follow.go

This file has not been changed.

appview/state/login.go

This file has not been changed.

appview/state/profile.go

This file has not been changed.

appview/state/reaction.go

This file has not been changed.

appview/state/star.go

This file has not been changed.

appview/state/state.go

This patch was likely rebased, as context lines do not match.

appview/state/timeline.go

This file has not been changed.

appview/strings/strings.go

This patch was likely rebased, as context lines do not match.

History

9 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
merge conflicts detected
expand
  • appview/pulls/pulls.go:1378
expand 0 comments
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
expand 0 comments
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
expand 0 comments
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
expand 0 comments
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
expand 0 comments
1 commit
expand
appview: remove oauth.User type
3/3 success
expand
expand 0 comments
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
expand 0 comments
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
expand 0 comments
1 commit
expand
appview: remove oauth.User type
2/3 failed, 1/3 success
expand
expand 0 comments