mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 12:27:43 +00:00
refactor: better error handling for server side calls (#101)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
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({
|
||||
@@ -11,3 +12,10 @@ export const auth = betterAuth({
|
||||
),
|
||||
plugins: [twoFactor()],
|
||||
});
|
||||
|
||||
try {
|
||||
await auth.api.signOut();
|
||||
} catch (e) {
|
||||
if (e instanceof APIError) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user