mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-28 09:56:25 -05: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) {
|
|
}
|
|
}
|