feat: improve account security
Support TOTP 2fa, allow for changing password, add session management and account removal.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { drizzleAdapter } from "@better-auth/drizzle-adapter/relations-v2";
|
||||
import { db } from "../server/lib/db";
|
||||
import { betterAuth } from 'better-auth/minimal';
|
||||
import { twoFactor } from 'better-auth/plugins/two-factor';
|
||||
import * as schema from '../drizzle/schema';
|
||||
|
||||
export const auth = betterAuth({
|
||||
@@ -22,6 +23,12 @@ export const auth = betterAuth({
|
||||
baseURL: process.env.NUXT_PUBLIC_URL ?? 'http://localhost:3000',
|
||||
trustedOrigins: [process.env.NUXT_PUBLIC_URL ?? 'http://localhost:3000'],
|
||||
|
||||
plugins: [
|
||||
twoFactor({
|
||||
issuer: 'Veridian',
|
||||
}),
|
||||
],
|
||||
|
||||
emailAndPassword: {
|
||||
// if DISABLE_LOCAL_AUTH is set to "1" or "true" then local auth is disabled
|
||||
enabled: process.env.DISABLE_LOCAL_AUTH?.toLowerCase() !== 'true' && process.env.DISABLE_LOCAL_AUTH !== '1',
|
||||
|
||||
Reference in New Issue
Block a user