@synqauth/plugin-passkey 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +21 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A Synq plugin for passkeys from your own UI.
|
|
|
4
4
|
|
|
5
5
|
Synq is customer identity for businesses: an OpenID Connect issuer for each of your brands, with Solana wallet, social, email and passkey sign-in. The documentation is at [docs.synq.build](https://docs.synq.build).
|
|
6
6
|
|
|
7
|
-
This package is at 0.x
|
|
7
|
+
This package is at 0.x, so a minor release can change its API: see its CHANGELOG.md.
|
|
8
8
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -25,13 +25,28 @@ function passkeyPlugin(options = {}) {
|
|
|
25
25
|
returnTo
|
|
26
26
|
}),
|
|
27
27
|
list: async () => {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const passkeys = [];
|
|
29
|
+
const followed = /* @__PURE__ */ new Set();
|
|
30
|
+
let cursor = null;
|
|
31
|
+
do {
|
|
32
|
+
const query = new URLSearchParams({ limit: "200" });
|
|
33
|
+
if (cursor) query.set("cursor", cursor);
|
|
34
|
+
const result = await call(request, `account/v1/passkeys?${query.toString()}`);
|
|
35
|
+
if (result.error) return {
|
|
36
|
+
data: null,
|
|
37
|
+
error: result.error
|
|
38
|
+
};
|
|
39
|
+
passkeys.push(...result.data.data);
|
|
40
|
+
const next = result.data.next_cursor ?? null;
|
|
41
|
+
if (next !== null && (next === "" || followed.has(next))) return {
|
|
42
|
+
data: null,
|
|
43
|
+
error: new SynqError("invalid_response", "account/v1/passkeys answered a next_cursor that can't be followed")
|
|
44
|
+
};
|
|
45
|
+
if (next !== null) followed.add(next);
|
|
46
|
+
cursor = next;
|
|
47
|
+
} while (cursor !== null);
|
|
33
48
|
return {
|
|
34
|
-
data:
|
|
49
|
+
data: passkeys,
|
|
35
50
|
error: null
|
|
36
51
|
};
|
|
37
52
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synqauth/plugin-passkey",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A Synq plugin for passkeys from your own UI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@synqauth/js": "0.
|
|
30
|
+
"@synqauth/js": "0.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"vitest": "5.0.2"
|