feaeet: add passkeys support
This commit is contained in:
@@ -1,27 +1,26 @@
|
||||
import { betterAuth } from 'better-auth'
|
||||
import { drizzleAdapter } from 'better-auth/adapters/drizzle'
|
||||
import { useDrizzle } from './db.js'
|
||||
import * as schema from '@/db/schema.ts'
|
||||
import { admin, bearer, username } from 'better-auth/plugins'
|
||||
import { betterAuth } from "better-auth";
|
||||
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
||||
import { useDrizzle } from "./db.js";
|
||||
import * as schema from "@/db/schema.ts";
|
||||
import { admin, bearer, username } from "better-auth/plugins";
|
||||
import { passkey } from "@better-auth/passkey";
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: drizzleAdapter(useDrizzle(), {
|
||||
provider: 'pg',
|
||||
provider: "pg",
|
||||
schema: {
|
||||
...schema,
|
||||
},
|
||||
}),
|
||||
trustedOrigins: [
|
||||
process.env.WEB_ORIGIN ?? 'http://localhost:3000',
|
||||
],
|
||||
trustedOrigins: [process.env.WEB_ORIGIN ?? "http://localhost:3000"],
|
||||
user: {
|
||||
additionalFields: {},
|
||||
},
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
},
|
||||
plugins: [admin(), username(), bearer()],
|
||||
plugins: [admin(), username(), bearer(), passkey()],
|
||||
advanced: {
|
||||
cookiePrefix: 'helios_auth',
|
||||
cookiePrefix: "helios_auth",
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user