docs: last changes

This commit is contained in:
Bereket Engida
2024-09-27 23:54:52 +03:00
parent bfa1337767
commit adc1b8ebe4
126 changed files with 18697 additions and 101 deletions

View File

@@ -0,0 +1,35 @@
import { createAuthClient } from "better-auth/react";
import {
organizationClient,
passkeyClient,
twoFactorClient,
} from "better-auth/client/plugins";
import { toast } from "sonner";
export const client = createAuthClient({
plugins: [
organizationClient(),
twoFactorClient({
twoFactorPage: "/two-factor",
}),
passkeyClient(),
],
fetchOptions: {
onError(e) {
if (e.error.status === 429) {
toast.error("Too many requests. Please try again later.");
}
},
},
});
export const {
signUp,
signIn,
signOut,
useSession,
user,
organization,
useListOrganizations,
useActiveOrganization,
} = client;