@better-auth/passkey 1.5.0-beta.1 → 1.5.0-beta.3

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/LICENSE.md CHANGED
@@ -1,17 +1,20 @@
1
1
  The MIT License (MIT)
2
2
  Copyright (c) 2024 - present, Bereket Engida
3
3
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5
- and associated documentation files (the "Software"), to deal in the Software without restriction,
6
- including without limitation the rights to use, copy, modify, merge, publish, distribute,
7
- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
8
- is furnished to do so, subject to the following conditions:
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the Software), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ the Software, and to permit persons to whom the Software is furnished to do so,
9
+ subject to the following conditions:
9
10
 
10
- The above copyright notice and this permission notice shall be included in all copies or
11
- substantial portions of the Software.
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
12
13
 
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
14
- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ THE SOFTWARE IS PROVIDED AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
+ DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -21,14 +21,14 @@ bun add better-auth @better-auth/passkey
21
21
  ### Server
22
22
 
23
23
  ```typescript
24
- import { betterAuth } from "better-auth";
25
- import { passkey } from "@better-auth/passkey";
24
+ import { betterAuth } from 'better-auth';
25
+ import { passkey } from '@better-auth/passkey';
26
26
 
27
27
  export const auth = betterAuth({
28
28
  plugins: [
29
29
  passkey({
30
- rpID: "example.com",
31
- rpName: "My App",
30
+ rpID: 'example.com',
31
+ rpName: 'My App',
32
32
  }),
33
33
  ],
34
34
  });
@@ -37,8 +37,8 @@ export const auth = betterAuth({
37
37
  ### Client
38
38
 
39
39
  ```typescript
40
- import { createAuthClient } from "better-auth/client";
41
- import { passkeyClient } from "@better-auth/passkey/client";
40
+ import { createAuthClient } from 'better-auth/client';
41
+ import { passkeyClient } from '@better-auth/passkey/client';
42
42
 
43
43
  export const authClient = createAuthClient({
44
44
  plugins: [passkeyClient()],
@@ -51,4 +51,4 @@ For more information, visit the [Better Auth Passkey documentation](https://bett
51
51
 
52
52
  ## License
53
53
 
54
- MIT
54
+ MIT
package/dist/client.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as WebAuthnChallengeValue, n as Passkey, r as PasskeyOptions, t as passkey } from "./index-C3Ju4ySN.mjs";
1
+ import { i as WebAuthnChallengeValue, n as Passkey, r as PasskeyOptions, t as passkey } from "./index-CdIR3B4H.mjs";
2
2
  import * as better_auth_client0 from "better-auth/client";
3
3
  import * as nanostores0 from "nanostores";
4
4
  import { atom } from "nanostores";
package/dist/client.mjs CHANGED
@@ -25,7 +25,8 @@ const getPasskeyActions = ($fetch, { $listPasskeys, $store }) => {
25
25
  $listPasskeys.set(Math.random());
26
26
  $store.notify("$sessionSignal");
27
27
  return verified;
28
- } catch {
28
+ } catch (err) {
29
+ console.error(`[Better Auth] Error verifying passkey`, err);
29
30
  return {
30
31
  data: null,
31
32
  error: {
@@ -128,6 +128,13 @@ type Passkey = {
128
128
  };
129
129
  //#endregion
130
130
  //#region src/index.d.ts
131
+ declare module "@better-auth/core" {
132
+ interface BetterAuthPluginRegistry<Auth, Context> {
133
+ passkey: {
134
+ creator: typeof passkey;
135
+ };
136
+ }
137
+ }
131
138
  declare const passkey: (options?: PasskeyOptions | undefined) => {
132
139
  id: "passkey";
133
140
  endpoints: {
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as Passkey, r as PasskeyOptions, t as passkey } from "./index-C3Ju4ySN.mjs";
1
+ import { n as Passkey, r as PasskeyOptions, t as passkey } from "./index-CdIR3B4H.mjs";
2
2
  export { Passkey, PasskeyOptions, passkey };
package/dist/index.mjs CHANGED
@@ -292,7 +292,7 @@ const verifyPasskeyRegistration = (options) => createAuthEndpoint("/passkey/veri
292
292
  model: "passkey",
293
293
  data: newPasskey
294
294
  });
295
- await ctx.context.internalAdapter.deleteVerificationByIdentifier(verificationToken);
295
+ await ctx.context.internalAdapter.deleteVerificationValue(data.id);
296
296
  return ctx.json(newPasskeyRes, { status: 200 });
297
297
  } catch (e) {
298
298
  ctx.context.logger.error("Failed to verify registration", e);
@@ -370,7 +370,7 @@ const verifyPasskeyAuthentication = (options) => createAuthEndpoint("/passkey/ve
370
370
  session: s,
371
371
  user
372
372
  });
373
- await ctx.context.internalAdapter.deleteVerificationByIdentifier(verificationToken);
373
+ await ctx.context.internalAdapter.deleteVerificationValue(data.id);
374
374
  return ctx.json({ session: s }, { status: 200 });
375
375
  } catch (e) {
376
376
  ctx.context.logger.error("Failed to verify authentication", e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/passkey",
3
- "version": "1.5.0-beta.1",
3
+ "version": "1.5.0-beta.3",
4
4
  "type": "module",
5
5
  "description": "Passkey plugin for Better Auth",
6
6
  "main": "dist/index.mjs",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "tsdown": "^0.17.2",
36
- "@better-auth/core": "1.5.0-beta.1",
37
- "better-auth": "1.5.0-beta.1"
36
+ "@better-auth/core": "1.5.0-beta.3",
37
+ "better-auth": "1.5.0-beta.3"
38
38
  },
39
39
  "dependencies": {
40
40
  "@simplewebauthn/browser": "^13.1.2",
@@ -44,10 +44,10 @@
44
44
  "peerDependencies": {
45
45
  "@better-auth/utils": "0.3.0",
46
46
  "@better-fetch/fetch": "1.1.21",
47
- "better-call": "1.1.7",
47
+ "better-call": "1.1.8",
48
48
  "nanostores": "^1.0.1",
49
- "@better-auth/core": "1.5.0-beta.1",
50
- "better-auth": "1.5.0-beta.1"
49
+ "@better-auth/core": "1.5.0-beta.3",
50
+ "better-auth": "1.5.0-beta.3"
51
51
  },
52
52
  "files": [
53
53
  "dist"