This commit is contained in:
Julien Calixte
2026-03-10 16:33:24 +01:00
parent 1135afb359
commit af49b233ef
2 changed files with 10 additions and 7 deletions

View File

@@ -1,9 +1,12 @@
import { BrowserOAuthClient, buildLoopbackClientId } from '@atproto/oauth-client-browser'
import {
BrowserOAuthClient,
buildLoopbackClientId,
} from "@atproto/oauth-client-browser"
const getClientId = () =>
import.meta.env.DEV
? buildLoopbackClientId(new URL(window.location.origin))
: 'https://remanso.space/client-metadata.json'
: "https://remanso.space/client-metadata.json"
let clientPromise: Promise<BrowserOAuthClient> | null = null
@@ -11,7 +14,7 @@ export const getOAuthClient = (): Promise<BrowserOAuthClient> => {
if (!clientPromise) {
clientPromise = BrowserOAuthClient.load({
clientId: getClientId(),
handleResolver: 'https://bsky.social',
handleResolver: "https://bsky.social",
})
}
return clientPromise