refactor: better error handling for server side calls (#101)

This commit is contained in:
Bereket Engida
2024-10-05 23:35:01 +03:00
committed by GitHub
parent 7cd1985d0e
commit 0ccf68ceed
20 changed files with 269 additions and 530 deletions

View File

@@ -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) {
}
}