@better-auth/passkey 1.4.0-beta.25 → 1.4.0-beta.27
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/dist/client.d.mts +19 -13
- package/dist/client.mjs +1 -0
- package/package.json +6 -6
package/dist/client.d.mts
CHANGED
|
@@ -3,8 +3,8 @@ import * as better_auth0 from "better-auth";
|
|
|
3
3
|
import * as nanostores0 from "nanostores";
|
|
4
4
|
import { atom } from "nanostores";
|
|
5
5
|
import * as _better_fetch_fetch0 from "@better-fetch/fetch";
|
|
6
|
-
import { BetterFetch
|
|
7
|
-
import { ClientStore } from "@better-auth/core";
|
|
6
|
+
import { BetterFetch } from "@better-fetch/fetch";
|
|
7
|
+
import { ClientFetchOption, ClientStore } from "@better-auth/core";
|
|
8
8
|
import { Session, User } from "better-auth/types";
|
|
9
9
|
|
|
10
10
|
//#region src/client.d.ts
|
|
@@ -21,8 +21,8 @@ declare const getPasskeyActions: ($fetch: BetterFetch, {
|
|
|
21
21
|
*/
|
|
22
22
|
passkey: (opts?: {
|
|
23
23
|
autoFill?: boolean;
|
|
24
|
-
fetchOptions?:
|
|
25
|
-
} | undefined, options?:
|
|
24
|
+
fetchOptions?: ClientFetchOption;
|
|
25
|
+
} | undefined, options?: ClientFetchOption | undefined) => Promise<{
|
|
26
26
|
data: null;
|
|
27
27
|
error: {
|
|
28
28
|
message?: string | undefined;
|
|
@@ -50,7 +50,7 @@ declare const getPasskeyActions: ($fetch: BetterFetch, {
|
|
|
50
50
|
* Add a passkey to the user account
|
|
51
51
|
*/
|
|
52
52
|
addPasskey: (opts?: {
|
|
53
|
-
fetchOptions?:
|
|
53
|
+
fetchOptions?: ClientFetchOption;
|
|
54
54
|
/**
|
|
55
55
|
* The name of the passkey. This is used to
|
|
56
56
|
* identify the passkey in the UI.
|
|
@@ -67,13 +67,16 @@ declare const getPasskeyActions: ($fetch: BetterFetch, {
|
|
|
67
67
|
* @default false
|
|
68
68
|
*/
|
|
69
69
|
useAutoRegister?: boolean;
|
|
70
|
-
} | undefined, fetchOpts?:
|
|
70
|
+
} | undefined, fetchOpts?: ClientFetchOption | undefined) => Promise<{
|
|
71
71
|
data: null;
|
|
72
72
|
error: {
|
|
73
73
|
message?: string | undefined;
|
|
74
74
|
status: number;
|
|
75
75
|
statusText: string;
|
|
76
76
|
};
|
|
77
|
+
} | {
|
|
78
|
+
data: Passkey;
|
|
79
|
+
error: null;
|
|
77
80
|
} | {
|
|
78
81
|
data: null;
|
|
79
82
|
error: {
|
|
@@ -82,7 +85,7 @@ declare const getPasskeyActions: ($fetch: BetterFetch, {
|
|
|
82
85
|
status: number;
|
|
83
86
|
statusText: string;
|
|
84
87
|
};
|
|
85
|
-
}
|
|
88
|
+
}>;
|
|
86
89
|
};
|
|
87
90
|
/**
|
|
88
91
|
* Inferred Internal Types
|
|
@@ -101,8 +104,8 @@ declare const passkeyClient: () => {
|
|
|
101
104
|
*/
|
|
102
105
|
passkey: (opts?: {
|
|
103
106
|
autoFill?: boolean;
|
|
104
|
-
fetchOptions?:
|
|
105
|
-
} | undefined, options?:
|
|
107
|
+
fetchOptions?: ClientFetchOption;
|
|
108
|
+
} | undefined, options?: ClientFetchOption | undefined) => Promise<{
|
|
106
109
|
data: null;
|
|
107
110
|
error: {
|
|
108
111
|
message?: string | undefined;
|
|
@@ -130,7 +133,7 @@ declare const passkeyClient: () => {
|
|
|
130
133
|
* Add a passkey to the user account
|
|
131
134
|
*/
|
|
132
135
|
addPasskey: (opts?: {
|
|
133
|
-
fetchOptions?:
|
|
136
|
+
fetchOptions?: ClientFetchOption;
|
|
134
137
|
/**
|
|
135
138
|
* The name of the passkey. This is used to
|
|
136
139
|
* identify the passkey in the UI.
|
|
@@ -147,13 +150,16 @@ declare const passkeyClient: () => {
|
|
|
147
150
|
* @default false
|
|
148
151
|
*/
|
|
149
152
|
useAutoRegister?: boolean;
|
|
150
|
-
} | undefined, fetchOpts?:
|
|
153
|
+
} | undefined, fetchOpts?: ClientFetchOption | undefined) => Promise<{
|
|
151
154
|
data: null;
|
|
152
155
|
error: {
|
|
153
156
|
message?: string | undefined;
|
|
154
157
|
status: number;
|
|
155
158
|
statusText: string;
|
|
156
159
|
};
|
|
160
|
+
} | {
|
|
161
|
+
data: Passkey;
|
|
162
|
+
error: null;
|
|
157
163
|
} | {
|
|
158
164
|
data: null;
|
|
159
165
|
error: {
|
|
@@ -162,7 +168,7 @@ declare const passkeyClient: () => {
|
|
|
162
168
|
status: number;
|
|
163
169
|
statusText: string;
|
|
164
170
|
};
|
|
165
|
-
}
|
|
171
|
+
}>;
|
|
166
172
|
};
|
|
167
173
|
/**
|
|
168
174
|
* Inferred Internal Types
|
|
@@ -179,7 +185,7 @@ declare const passkeyClient: () => {
|
|
|
179
185
|
isRefetching: boolean;
|
|
180
186
|
refetch: (queryParams?: {
|
|
181
187
|
query?: better_auth0.SessionQueryParams;
|
|
182
|
-
} | undefined) => void
|
|
188
|
+
} | undefined) => Promise<void>;
|
|
183
189
|
}> & object;
|
|
184
190
|
$listPasskeys: nanostores0.PreinitializedWritableAtom<any> & object;
|
|
185
191
|
};
|
package/dist/client.mjs
CHANGED
|
@@ -63,6 +63,7 @@ const getPasskeyActions = ($fetch, { $listPasskeys, $store }) => {
|
|
|
63
63
|
});
|
|
64
64
|
if (!verified.data) return verified;
|
|
65
65
|
$listPasskeys.set(Math.random());
|
|
66
|
+
return verified;
|
|
66
67
|
} catch (e) {
|
|
67
68
|
if (e instanceof WebAuthnError) {
|
|
68
69
|
if (e.code === "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED") return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/passkey",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Passkey plugin for Better Auth",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"tsdown": "^0.16.0",
|
|
35
|
-
"@better-auth/core": "1.4.0-beta.
|
|
36
|
-
"better-auth": "1.4.0-beta.
|
|
35
|
+
"@better-auth/core": "1.4.0-beta.27",
|
|
36
|
+
"better-auth": "1.4.0-beta.27"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@simplewebauthn/browser": "^13.1.2",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@better-auth/utils": "0.3.0",
|
|
45
45
|
"@better-fetch/fetch": "1.1.18",
|
|
46
|
-
"better-call": "1.0
|
|
46
|
+
"better-call": "1.1.0",
|
|
47
47
|
"nanostores": "^1.0.1",
|
|
48
|
-
"@better-auth/core": "1.4.0-beta.
|
|
49
|
-
"better-auth": "1.4.0-beta.
|
|
48
|
+
"@better-auth/core": "1.4.0-beta.27",
|
|
49
|
+
"better-auth": "1.4.0-beta.27"
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"dist"
|