diff --git a/netlify.toml b/netlify.toml index d9ef8b2..3cd2705 100644 --- a/netlify.toml +++ b/netlify.toml @@ -7,6 +7,17 @@ from = "/.well-known/*" to = "/.well-known/:splat" status = 200 +[[headers]] +for = "/client-metadata.json" + [headers.values] + Access-Control-Allow-Origin = "*" + Content-Type = "application/json" + +[[redirects]] +from = "/client-metadata.json" +to = "/client-metadata.json" +status = 200 + [[redirects]] from = "/*" to = "/" diff --git a/public/client-metadata.json b/public/client-metadata.json index 671d3ab..76718e8 100644 --- a/public/client-metadata.json +++ b/public/client-metadata.json @@ -3,8 +3,7 @@ "client_name": "Remanso", "client_uri": "https://remanso.space", "redirect_uris": [ - "https://remanso.space/", - "http://localhost:5173/" + "https://remanso.space/" ], "scope": "atproto transition:generic", "grant_types": ["authorization_code", "refresh_token"], diff --git a/src/modules/atproto/service/atprotoOAuth.ts b/src/modules/atproto/service/atprotoOAuth.ts index 7804083..ccb500e 100644 --- a/src/modules/atproto/service/atprotoOAuth.ts +++ b/src/modules/atproto/service/atprotoOAuth.ts @@ -8,7 +8,10 @@ let clientPromise: Promise | null = null export const getOAuthClient = (): Promise => { if (!clientPromise) { - clientPromise = BrowserOAuthClient.load({ clientId: CLIENT_ID }) + clientPromise = BrowserOAuthClient.load({ + clientId: CLIENT_ID, + handleResolver: 'https://bsky.social', + }) } return clientPromise }