mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-07 04:19:22 +00:00
22 lines
409 B
TypeScript
22 lines
409 B
TypeScript
import { betterAuth } from "better-auth";
|
|
import { prismaAdapter } from "better-auth/adapters/prisma";
|
|
import { APIError } from "better-auth/api";
|
|
import { twoFactor } from "better-auth/plugins";
|
|
|
|
export const auth = betterAuth({
|
|
database: prismaAdapter(
|
|
{},
|
|
{
|
|
provider: "mysql",
|
|
},
|
|
),
|
|
plugins: [twoFactor()],
|
|
});
|
|
|
|
try {
|
|
await auth.api.signOut();
|
|
} catch (e) {
|
|
if (e instanceof APIError) {
|
|
}
|
|
}
|