Monorepo for Tangled tangled.org

appview: drain pds rewrites on any active sessions #1308

open opened by boltless.me targeting master from sl/mnznnmqwysmz
Labels

None yet.

assignee
Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3mjak3un7al22
+15 -1
Diff #1
+13 -1
appview/oauth/handler.go
··· 96 96 go o.addToDefaultSpindle(sessData.AccountDID.String()) 97 97 go o.ensureTangledProfile(sessData) 98 98 go o.autoClaimTnglShDomain(sessData.AccountDID.String()) 99 - go o.drainPdsRewrites(sessData) 100 99 101 100 if !o.Config.Core.Dev { 102 101 err = o.Posthog.Enqueue(posthog.Capture{ ··· 275 274 l.Debug("successfully created empty Tangled profile on PDS and DB") 276 275 } 277 276 277 + func (o *OAuth) PdsRewriteMiddleware(next http.Handler) http.Handler { 278 + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 279 + defer next.ServeHTTP(w, r) 280 + 281 + sess, err := o.ResumeSession(r) 282 + if err != nil { 283 + return 284 + } 285 + 286 + go o.drainPdsRewrites(sess.Data) 287 + }) 288 + } 289 + 278 290 func (o *OAuth) drainPdsRewrites(sessData *oauth.ClientSessionData) { 279 291 ctx := context.Background() 280 292 did := sessData.AccountDID.String()
+2
appview/state/router.go
··· 36 36 s.logger, 37 37 ) 38 38 39 + router.Use(s.oauth.PdsRewriteMiddleware) 40 + 39 41 router.Get("/pwa-manifest.json", s.WebAppManifest) 40 42 router.Get("/robots.txt", s.RobotsTxt) 41 43 router.Get("/.well-known/security.txt", s.SecurityTxt)

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview: drain pds rewrites on any active sessions
3/3 failed
expand
no conflicts, ready to merge
expand 0 comments
1 commit
expand
appview: drain pds rewrites on any active sessions
3/3 failed
expand
expand 0 comments