fix: add rate limter error

This commit is contained in:
Bereket Engida
2024-09-24 02:41:01 +03:00
parent bc82bf3d30
commit 6c9782202f
10 changed files with 70 additions and 49 deletions

View File

@@ -4,6 +4,7 @@ import {
passkeyClient,
twoFactorClient,
} from "better-auth/client/plugins";
import { toast } from "sonner";
export const client = createAuthClient({
plugins: [
@@ -14,7 +15,11 @@ export const client = createAuthClient({
passkeyClient(),
],
fetchOptions: {
credentials: "include",
onError(e) {
if (e.error.status === 429) {
toast.error("Too many requests. Please try again later.");
}
},
},
});