diff --git a/packages/better-auth/src/plugins/admin/admin.ts b/packages/better-auth/src/plugins/admin/admin.ts index 3a17437ce1..f3eaeee9e7 100644 --- a/packages/better-auth/src/plugins/admin/admin.ts +++ b/packages/better-auth/src/plugins/admin/admin.ts @@ -1380,6 +1380,7 @@ export const admin = (options?: O) => { }, $ERROR_CODES: ADMIN_ERROR_CODES, schema: mergeSchema(schema, opts.schema), + options: options as any, } satisfies BetterAuthPlugin; }; diff --git a/packages/better-auth/src/plugins/organization/organization.ts b/packages/better-auth/src/plugins/organization/organization.ts index 406fbce45b..4197d9c633 100644 --- a/packages/better-auth/src/plugins/organization/organization.ts +++ b/packages/better-auth/src/plugins/organization/organization.ts @@ -752,5 +752,6 @@ export const organization = (options?: O) => { >, }, $ERROR_CODES: ORGANIZATION_ERROR_CODES, + options: options as any, } satisfies BetterAuthPlugin; }; diff --git a/packages/better-auth/src/plugins/two-factor/otp/index.ts b/packages/better-auth/src/plugins/two-factor/otp/index.ts index d9324f3edb..a097927839 100644 --- a/packages/better-auth/src/plugins/two-factor/otp/index.ts +++ b/packages/better-auth/src/plugins/two-factor/otp/index.ts @@ -376,7 +376,7 @@ export const otp2fa = (options?: OTPOptions) => { await ctx.context.internalAdapter.updateVerificationValue( toCheckOtp.id, { - value: `${otp}!${parseInt(counter) + 1}`, + value: `${otp}:${(parseInt(counter, 10) || 0) + 1}`, }, ); return invalid("INVALID_CODE"); diff --git a/packages/better-auth/src/plugins/two-factor/totp/index.ts b/packages/better-auth/src/plugins/two-factor/totp/index.ts index 5a7974780e..f1ba9bfd55 100644 --- a/packages/better-auth/src/plugins/two-factor/totp/index.ts +++ b/packages/better-auth/src/plugins/two-factor/totp/index.ts @@ -154,7 +154,7 @@ export const totp2fa = (options?: TOTPOptions) => { }, ], }); - if (!twoFactor || !user.twoFactorEnabled) { + if (!twoFactor) { throw new APIError("BAD_REQUEST", { message: TWO_FACTOR_ERROR_CODES.TOTP_NOT_ENABLED, }); diff --git a/packages/expo/src/client.ts b/packages/expo/src/client.ts index a0c72a89f0..0525a9f0b5 100644 --- a/packages/expo/src/client.ts +++ b/packages/expo/src/client.ts @@ -1,4 +1,4 @@ -import type { BetterAuthClientPlugin, Store } from "better-auth"; +import { BetterAuthClientPlugin, Store } from "better-auth/types"; import * as Browser from "expo-web-browser"; import * as Linking from "expo-linking"; import { Platform } from "react-native"; diff --git a/packages/expo/src/index.ts b/packages/expo/src/index.ts index 79f364f8ce..1cbcbe8fd2 100644 --- a/packages/expo/src/index.ts +++ b/packages/expo/src/index.ts @@ -1,4 +1,4 @@ -import type { BetterAuthPlugin } from "better-auth"; +import type { BetterAuthPlugin } from "better-auth/types"; import { createAuthMiddleware } from "better-auth/api"; export interface ExpoOptions {