Monorepo for Tangled tangled.org

appview/oauth: support local PDS

override `Client.Transport` to support PDS served in localhost

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

boltless.me d0fa16e0 3e73d585

verified
Changed files
+5
appview
oauth
state
+4
appview/oauth/oauth.go
··· 60 60 61 61 clientApp := oauth.NewClientApp(&oauthConfig, authStore) 62 62 clientApp.Dir = res.Directory() 63 + // allow non-public transports in dev mode 64 + if config.Core.Dev { 65 + clientApp.Resolver.Client.Transport = http.DefaultTransport 66 + } 63 67 64 68 return &OAuth{ 65 69 ClientApp: clientApp,
+1
appview/state/login.go
··· 46 46 47 47 redirectURL, err := s.oauth.ClientApp.StartAuthFlow(r.Context(), handle) 48 48 if err != nil { 49 + l.Error("failed to start auth", "err", err) 49 50 http.Error(w, err.Error(), http.StatusInternalServerError) 50 51 return 51 52 }