feat: basic admin interface

This commit is contained in:
Zoe
2026-10-08 13:41:02 -05:00
parent 7b0800882a
commit f6e1bc1f47
27 changed files with 4095 additions and 49 deletions
+2 -2
View File
@@ -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);