@better-auth/passkey 1.6.6 → 1.6.8

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PasskeyExtensionsResolver, c as PasskeyRegistrationUser, i as PasskeyAuthenticationOptions, l as WebAuthnChallengeValue, n as PASSKEY_ERROR_CODES, o as PasskeyOptions, r as Passkey, s as PasskeyRegistrationOptions, t as passkey } from "./index-DD5Lute1.mjs";
1
+ import { a as PasskeyExtensionsResolver, c as PasskeyRegistrationUser, i as PasskeyAuthenticationOptions, l as WebAuthnChallengeValue, n as PASSKEY_ERROR_CODES, o as PasskeyOptions, r as Passkey, s as PasskeyRegistrationOptions, t as passkey } from "./index-BoC1i3hA.mjs";
2
2
  import { AuthenticationExtensionsClientInputs, AuthenticationExtensionsClientOutputs, AuthenticationResponseJSON, RegistrationResponseJSON } from "@simplewebauthn/server";
3
3
  import * as better_auth_client0 from "better-auth/client";
4
4
  import * as nanostores from "nanostores";
package/dist/client.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as PASSKEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-CJSQUcOV.mjs";
1
+ import { n as PASSKEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-Bl_WeaI-.mjs";
2
2
  import { WebAuthnError, startAuthentication, startRegistration } from "@simplewebauthn/browser";
3
3
  import { useAuthQuery } from "better-auth/client";
4
4
  import { atom } from "nanostores";
@@ -250,7 +250,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
250
250
  image?: string | null | undefined;
251
251
  };
252
252
  };
253
- }>)[] | undefined;
253
+ }>)[];
254
254
  query: zod.ZodOptional<zod.ZodObject<{
255
255
  authenticatorAttachment: zod.ZodOptional<zod.ZodEnum<{
256
256
  platform: "platform";
@@ -503,7 +503,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
503
503
  image?: string | null | undefined;
504
504
  };
505
505
  };
506
- }>)[] | undefined;
506
+ }>)[];
507
507
  metadata: {
508
508
  openapi: {
509
509
  operationId: string;
@@ -573,6 +573,15 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
573
573
  ipAddress?: string | null | undefined;
574
574
  userAgent?: string | null | undefined;
575
575
  };
576
+ user: {
577
+ id: string;
578
+ createdAt: Date;
579
+ updatedAt: Date;
580
+ email: string;
581
+ emailVerified: boolean;
582
+ name: string;
583
+ image?: string | null | undefined;
584
+ };
576
585
  }>;
577
586
  listPasskeys: better_call0.StrictEndpoint<"/passkey/list-user-passkeys", {
578
587
  method: "GET";
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as PASSKEY_ERROR_CODES, o as PasskeyOptions, r as Passkey, t as passkey } from "./index-DD5Lute1.mjs";
1
+ import { n as PASSKEY_ERROR_CODES, o as PasskeyOptions, r as Passkey, t as passkey } from "./index-BoC1i3hA.mjs";
2
2
  export { PASSKEY_ERROR_CODES, Passkey, PasskeyOptions, passkey };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as PASSKEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-CJSQUcOV.mjs";
1
+ import { n as PASSKEY_ERROR_CODES, t as PACKAGE_VERSION } from "./version-Bl_WeaI-.mjs";
2
2
  import { mergeSchema } from "better-auth/db";
3
3
  import { createAuthEndpoint } from "@better-auth/core/api";
4
4
  import { APIError } from "@better-auth/core/error";
@@ -55,7 +55,7 @@ const generatePasskeyQuerySchema = z.object({
55
55
  const generatePasskeyRegistrationOptions = (opts, { maxAgeInSeconds }) => {
56
56
  return createAuthEndpoint("/passkey/generate-register-options", {
57
57
  method: "GET",
58
- use: opts.registration?.requireSession ?? true ? [freshSessionMiddleware] : void 0,
58
+ use: opts.registration?.requireSession ?? true ? [freshSessionMiddleware] : [],
59
59
  query: generatePasskeyQuerySchema,
60
60
  metadata: { openapi: {
61
61
  operationId: "generatePasskeyRegistrationOptions",
@@ -294,7 +294,7 @@ const verifyPasskeyRegistration = (options) => {
294
294
  return createAuthEndpoint("/passkey/verify-registration", {
295
295
  method: "POST",
296
296
  body: verifyPasskeyRegistrationBodySchema,
297
- use: requireSession ? [freshSessionMiddleware] : void 0,
297
+ use: requireSession ? [freshSessionMiddleware] : [],
298
298
  metadata: { openapi: {
299
299
  operationId: "passkeyVerifyRegistration",
300
300
  description: "Verify registration of a new passkey",
@@ -451,7 +451,10 @@ const verifyPasskeyAuthentication = (options) => createAuthEndpoint("/passkey/ve
451
451
  user
452
452
  });
453
453
  await ctx.context.internalAdapter.deleteVerificationByIdentifier(verificationToken);
454
- return ctx.json({ session: s }, { status: 200 });
454
+ return ctx.json({
455
+ session: s,
456
+ user
457
+ }, { status: 200 });
455
458
  } catch (e) {
456
459
  ctx.context.logger.error("Failed to verify authentication", e);
457
460
  throw APIError.from("BAD_REQUEST", PASSKEY_ERROR_CODES.AUTHENTICATION_FAILED);
@@ -18,6 +18,6 @@ const PASSKEY_ERROR_CODES = defineErrorCodes({
18
18
  });
19
19
  //#endregion
20
20
  //#region src/version.ts
21
- const PACKAGE_VERSION = "1.6.6";
21
+ const PACKAGE_VERSION = "1.6.8";
22
22
  //#endregion
23
23
  export { PASSKEY_ERROR_CODES as n, PACKAGE_VERSION as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/passkey",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "description": "Passkey plugin for Better Auth",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -55,16 +55,16 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "tsdown": "0.21.1",
58
- "@better-auth/core": "1.6.6",
59
- "better-auth": "1.6.6"
58
+ "@better-auth/core": "1.6.8",
59
+ "better-auth": "1.6.8"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@better-auth/utils": "0.4.0",
63
63
  "@better-fetch/fetch": "1.1.21",
64
64
  "better-call": "1.3.5",
65
65
  "nanostores": "^1.0.1",
66
- "@better-auth/core": "^1.6.6",
67
- "better-auth": "^1.6.6"
66
+ "@better-auth/core": "^1.6.8",
67
+ "better-auth": "^1.6.8"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "tsdown",