mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-07 20:37:44 +00:00
fix: add rate limter error
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user