···
17
17
const params = new URLSearchParams(location.hash.slice(1));
18
18
19
19
finalizeAuthorization(params)
20
20
-
.then((agent) => {
20
20
+
.then(agent => {
21
21
localStorage.setItem("ypds:did", agent.session.info.sub);
22
22
-
window.location.assign("/");
22
22
+
window.location.assign("/y-pds/");
23
23
})
24
24
-
.catch((err) => console.error(err));
24
24
+
.catch(err => console.error(err));
25
25
</script>
···
1
1
{
2
2
-
"client_id": "https://ff10-66-108-106-210.ngrok-free.app/client-metadata.json",
3
3
-
"client_uri": "https://ff10-66-108-106-210.ngrok-free.app",
4
4
-
"redirect_uris": ["https://ff10-66-108-106-210.ngrok-free.app/callback.html"],
2
2
+
"client_id": "https://jake.tngl.io/y-pds/client-metadata.json",
3
3
+
"client_uri": "https://jake.tngl.io/y-pds",
4
4
+
"redirect_uris": ["https://jake.tngl.io/y-pds/callback.html"],
5
5
"application_type": "native",
6
6
"client_name": "atrtc demo",
7
7
"dpop_bound_access_tokens": true,
8
8
"grant_types": ["authorization_code", "refresh_token"],
9
9
"response_types": ["code"],
10
10
-
"scope": "atproto repo?collection=com.jakelazaroff.ypds.doc&collection=com.jakelazaroff.ypds.update&collection=com.jakelazaroff.ypds.awareness&collection=com.jakelazaroff.ypds.snapshot",
10
10
+
"scope": "atproto repo?collection=jake.tngl.io.ypds.doc&collection=jake.tngl.io.ypds.update&collection=jake.tngl.io.ypds.awareness&collection=jake.tngl.io.ypds.snapshot",
11
11
"token_endpoint_auth_method": "none"
12
12
}
···
25
25
}
26
26
}
27
27
</script>
28
28
-
<link rel="stylesheet" href="/style.css" />
28
28
+
<link rel="stylesheet" href="./style.css" />
29
29
</head>
30
30
<body>
31
31
<div id="app"></div>
···
2
2
import * as Y from "yjs";
3
3
import { Awareness, encodeAwarenessUpdate, applyAwarenessUpdate } from "y-protocols/awareness";
4
4
5
5
-
export const DOC_COLLECTION = "com.jakelazaroff.ypds.doc";
6
6
-
export const UPDATE_COLLECTION = "com.jakelazaroff.ypds.update";
7
7
-
export const AWARENESS_COLLECTION = "com.jakelazaroff.ypds.awareness";
5
5
+
export const DOC_COLLECTION = "jake.tngl.io.ypds.doc";
6
6
+
export const UPDATE_COLLECTION = "jake.tngl.io.ypds.update";
7
7
+
export const AWARENESS_COLLECTION = "jake.tngl.io.ypds.awareness";
8
8
9
9
const encode = (/** @type {Uint8Array} */ update) => btoa(String.fromCharCode(...update));
10
10
const decode = (/** @type {string} */ b64) => Uint8Array.from(atob(b64), c => c.charCodeAt(0));