appview/oauth: support custom PLC directory #704

closed
opened by boltless.me targeting master from sandboxed-atmosphere
  • inherit idResolver's PLC directory for oauth
  • override Client.Transport to support PDS served in localhost

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

Changed files
+5
appview
oauth
state
+4
appview/oauth/oauth.go
···
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
+
}
return &OAuth{
ClientApp: clientApp,
+1
appview/state/login.go
···
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
}