···97979898 fmt.Printf("DEBUG: Base URL for OAuth: %s\n", baseURL)
9999100100+ // Extract default hold DID for OAuth server and backfill worker
101101+ // This is used to create sailor profiles on first login and cache captain records
102102+ // Expected format: "did:web:hold01.atcr.io"
103103+ // To find a hold's DID, visit: https://hold01.atcr.io/.well-known/did.json
104104+ // The extraction function normalizes URLs to DIDs for consistency
105105+ defaultHoldDID := appview.ExtractDefaultHoldDID(config)
106106+100107 // Create OAuth app (indigo client)
101101- oauthApp, err := oauth.NewApp(baseURL, oauthStore)
108108+ oauthApp, err := oauth.NewApp(baseURL, oauthStore, defaultHoldDID)
102109 if err != nil {
103110 return fmt.Errorf("failed to create OAuth app: %w", err)
104111 }
···124131 holdAuthorizer := auth.NewRemoteHoldAuthorizer(uiDatabase, testMode)
125132 middleware.SetGlobalAuthorizer(holdAuthorizer)
126133 fmt.Println("Hold authorizer initialized with database caching")
127127-128128- // 6.7. Extract default hold DID for OAuth server and backfill worker
129129- // This is used to create sailor profiles on first login and cache captain records
130130- // Expected format: "did:web:hold01.atcr.io"
131131- // To find a hold's DID, visit: https://hold01.atcr.io/.well-known/did.json
132132- // The extraction function normalizes URLs to DIDs for consistency
133133- defaultHoldDID := appview.ExtractDefaultHoldDID(config)
134134135135 // Initialize UI routes with OAuth app, refresher, and device store
136136 uiTemplates, uiRouter := initializeUIRoutes(uiDatabase, uiReadOnlyDB, uiSessionStore, oauthApp, refresher, baseURL, deviceStore, defaultHoldDID)
···196196197197 // OAuth client metadata endpoint
198198 mux.HandleFunc("/client-metadata.json", func(w http.ResponseWriter, r *http.Request) {
199199- config := oauth.NewClientConfig(baseURL)
199199+ config := oauthApp.GetConfig()
200200 metadata := config.ClientMetadata()
201201202202 w.Header().Set("Content-Type", "application/json")
+1-5
cmd/hold/main.go
···9292 })
93939494 // Register XRPC/ATProto PDS endpoints if PDS is initialized
9595- // TODO: Migrate pds.RegisterHandlers to use chi.Router
9695 if xrpcHandler != nil {
9796 log.Printf("Registering ATProto PDS endpoints")
9898- // PDS still uses http.ServeMux, so we mount it temporarily
9999- pdsMux := http.NewServeMux()
100100- xrpcHandler.RegisterHandlers(pdsMux)
101101- r.Mount("/", pdsMux)
9797+ xrpcHandler.RegisterHandlers(r)
10298 }
10399104100 // Register OCI multipart upload endpoints