Spaces:
Sleeping
Sleeping
File size: 649 Bytes
05c5ed5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | "use client";
import { createAuthClient } from "better-auth/react"; // make sure to import from better-auth/react
import { adminClient, inferAdditionalFields } from "better-auth/client/plugins";
import { DEFAULT_USER_ROLE, USER_ROLES } from "app-types/roles";
import { ac, admin, editor, user } from "./roles";
import type { auth } from "./auth-instance";
export const authClient = createAuthClient({
plugins: [
inferAdditionalFields<typeof auth>(),
adminClient({
defaultRole: DEFAULT_USER_ROLE,
adminRoles: [USER_ROLES.ADMIN],
ac,
roles: {
admin,
editor,
user,
},
}),
],
});
|