+7
-5
lib/oauth/client.ts
+7
-5
lib/oauth/client.ts
···
14
14
const publicUrl = Deno.env.get("PUBLIC_URL");
15
15
const url = publicUrl || `http://127.0.0.1:8000`;
16
16
const enc = encodeURIComponent;
17
+
const clientId = publicUrl
18
+
? `${url}/oauth-client-metadata.json`
19
+
: `http://localhost?redirect_uri=${
20
+
enc(`${url}/api/oauth/callback`)
21
+
}&scope=${enc("atproto transition:generic transition:chat.bsky")}`;
22
+
console.log(`ClientId: ${clientId}`);
17
23
18
24
return new AtprotoOAuthClient({
19
25
clientMetadata: {
20
26
client_name: "Statusphere React App",
21
-
client_id: publicUrl
22
-
? `${url}/oauth-client-metadata.json`
23
-
: `http://localhost?redirect_uri=${
24
-
enc(`${url}/api/oauth/callback`)
25
-
}&scope=${enc("atproto transition:generic transition:chat.bsky")}`,
27
+
client_id: clientId,
26
28
client_uri: url,
27
29
redirect_uris: [`${url}/api/oauth/callback`],
28
30
scope: "atproto transition:generic transition:chat.bsky",
+19
static/oauth-client-metadata.json
+19
static/oauth-client-metadata.json
···
1
+
{
2
+
"client_name": "ATP Airport",
3
+
"client_id": "https://atpairport.com/oauth-client-metadata.json",
4
+
"client_uri": "https://atpairport.com",
5
+
"redirect_uris": [
6
+
"https://atpairport.com/api/oauth/callback"
7
+
],
8
+
"scope": "atproto transition:generic transition:chat.bsky",
9
+
"grant_types": [
10
+
"authorization_code",
11
+
"refresh_token"
12
+
],
13
+
"response_types": [
14
+
"code"
15
+
],
16
+
"application_type": "web",
17
+
"token_endpoint_auth_method": "none",
18
+
"dpop_bound_access_tokens": true
19
+
}