From 67efbe279713bdf593dc57ab96c480e722f521dd Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Fri, 10 Oct 2025 14:45:44 -0500 Subject: [PATCH] fix oauth issues on hold service --- cmd/hold/main.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/hold/main.go b/cmd/hold/main.go index ba8eb3f..5291fe0 100644 --- a/cmd/hold/main.go +++ b/cmd/hold/main.go @@ -768,9 +768,19 @@ func main() { // This is referenced by its client ID URL mux.HandleFunc("/client-metadata.json", func(w http.ResponseWriter, r *http.Request) { // Create a temporary config to generate metadata (indigo provides this) - redirectURI := cfg.Server.PublicURL + "/oauth/callback" + redirectURI := cfg.Server.PublicURL + "/auth/oauth/callback" clientID := cfg.Server.PublicURL + "/client-metadata.json" - scopes := []string{"atproto"} // Hold service uses default scopes + + // Define scopes needed for hold registration + scopes := []string{ + "atproto", + fmt.Sprintf("repo:%s?action=create", atproto.HoldCollection), + fmt.Sprintf("repo:%s?action=update", atproto.HoldCollection), + fmt.Sprintf("repo:%s?action=create", atproto.HoldCrewCollection), + fmt.Sprintf("repo:%s?action=update", atproto.HoldCrewCollection), + fmt.Sprintf("repo:%s?action=create", atproto.SailorProfileCollection), + fmt.Sprintf("repo:%s?action=update", atproto.SailorProfileCollection), + } config := indigooauth.NewPublicConfig(clientID, redirectURI, scopes) metadata := config.ClientMetadata() @@ -1035,6 +1045,8 @@ func (s *HoldService) registerWithOAuth(publicURL, handle, did, pdsEndpoint stri fmt.Sprintf("repo:%s?action=update", atproto.HoldCollection), fmt.Sprintf("repo:%s?action=create", atproto.HoldCrewCollection), fmt.Sprintf("repo:%s?action=update", atproto.HoldCrewCollection), + fmt.Sprintf("repo:%s?action=create", atproto.SailorProfileCollection), + fmt.Sprintf("repo:%s?action=update", atproto.SailorProfileCollection), } // Determine base URL based on mode