mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-26 00:46:44 -05:00
fix: totp should default to app name if issuer isn't provided
This commit is contained in:
@@ -22,7 +22,7 @@ export const twoFactor = (options?: TwoFactorOptions) => {
|
||||
};
|
||||
const totp = totp2fa(
|
||||
{
|
||||
issuer: options?.issuer || "better-auth",
|
||||
issuer: options?.issuer,
|
||||
...options?.totpOptions,
|
||||
},
|
||||
opts.twoFactorTable,
|
||||
|
||||
@@ -18,7 +18,7 @@ export type TOTPOptions = {
|
||||
/**
|
||||
* Issuer
|
||||
*/
|
||||
issuer: string;
|
||||
issuer?: string;
|
||||
/**
|
||||
* How many digits the otp to be
|
||||
*
|
||||
@@ -115,7 +115,7 @@ export const totp2fa = (options: TOTPOptions, twoFactorTable: string) => {
|
||||
await ctx.context.password.checkPassword(user.id, ctx);
|
||||
return {
|
||||
totpURI: createTOTPKeyURI(
|
||||
options?.issuer || "BetterAuth",
|
||||
options.issuer || ctx.context.appName,
|
||||
user.email,
|
||||
Buffer.from(twoFactor.secret),
|
||||
opts,
|
||||
|
||||
Reference in New Issue
Block a user