From 50b50114d41466307cb903720f8edc5406e0de5f Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sun, 19 Oct 2025 22:38:47 +0900 Subject: [PATCH] appview/oauth: support local PDS Change-Id: kxozpvvnyuuormzuppxyuxopuzxpmkoz override `Client.Transport` to support PDS served in localhost Signed-off-by: Seongmin Lee --- appview/oauth/oauth.go | 4 ++++ appview/state/login.go | 1 + 2 files changed, 5 insertions(+) diff --git a/appview/oauth/oauth.go b/appview/oauth/oauth.go index ba204f5a..cc1245a9 100644 --- a/appview/oauth/oauth.go +++ b/appview/oauth/oauth.go @@ -74,6 +74,10 @@ func New(config *config.Config, ph posthog.Client, db *db.DB, enforcer *rbac.Enf clientApp := oauth.NewClientApp(&oauthConfig, authStore) clientApp.Dir = res.Directory() + // allow non-public transports in dev mode + if config.Core.Dev { + clientApp.Resolver.Client.Transport = http.DefaultTransport + } clientName := config.Core.AppviewName diff --git a/appview/state/login.go b/appview/state/login.go index 89797cb7..309ef2f5 100644 --- a/appview/state/login.go +++ b/appview/state/login.go @@ -46,6 +46,7 @@ func (s *State) Login(w http.ResponseWriter, r *http.Request) { redirectURL, err := s.oauth.ClientApp.StartAuthFlow(r.Context(), handle) if err != nil { + l.Error("failed to start auth", "err", err) http.Error(w, err.Error(), http.StatusInternalServerError) return } -- 2.43.0