feat: basic admin interface
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { BetterAuthClientOptions, InferSessionFromClient, InferUserFromClient, User } from 'better-auth/client';
|
||||
import { twoFactorClient } from 'better-auth/client/plugins';
|
||||
import { adminClient, twoFactorClient } from 'better-auth/client/plugins';
|
||||
import { createAuthClient } from 'better-auth/vue';
|
||||
import { Err, Ok, type Result } from '~~/types/result';
|
||||
import { assert } from '~~/utils/assert';
|
||||
@@ -31,7 +31,7 @@ export type SignInResult =
|
||||
|
||||
export const useAuth = () => {
|
||||
const authClient = createAuthClient({
|
||||
plugins: [twoFactorClient()],
|
||||
plugins: [twoFactorClient(), adminClient()],
|
||||
});
|
||||
const session = useState<InferSessionFromClient<BetterAuthClientOptions> | null>('auth:session', () => null);
|
||||
const user = useState<AuthUser | null>('auth:user', () => null);
|
||||
|
||||
Reference in New Issue
Block a user