Merge branch 'main' into v1.3

This commit is contained in:
Bereket Engida
2025-07-07 13:44:20 -07:00
6 changed files with 6 additions and 4 deletions

View File

@@ -1380,6 +1380,7 @@ export const admin = <O extends AdminOptions>(options?: O) => {
},
$ERROR_CODES: ADMIN_ERROR_CODES,
schema: mergeSchema(schema, opts.schema),
options: options as any,
} satisfies BetterAuthPlugin;
};

View File

@@ -752,5 +752,6 @@ export const organization = <O extends OrganizationOptions>(options?: O) => {
>,
},
$ERROR_CODES: ORGANIZATION_ERROR_CODES,
options: options as any,
} satisfies BetterAuthPlugin;
};

View File

@@ -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");

View File

@@ -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,
});

View File

@@ -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";

View File

@@ -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 {