UNPKG

aau-auth-kit-ui

Version:

Plug & play shadcn/ui components for aau-auth-kit with Next.js integration

21 lines (18 loc) 758 B
import type { User as AnyUser } from "aau-auth-kit"; import type { Session, User } from "./auth-client"; import type { FetchError } from "./fetch-error"; type AuthHook<T> = { isPending: boolean; data?: T | null; error?: FetchError | null; // biome-ignore lint/suspicious/noExplicitAny: refetch?: () => Promise<any> | any; }; export type AuthHooks = { useSession: () => AuthHook<{ session: Session; user: User }>; useListAccounts: () => AuthHook<{ accountId: string; provider: string }[]>; useListDeviceSessions: () => AuthHook<{ session: Session; user: AnyUser }[]>; useListSessions: () => AuthHook<Session[]>; useListPasskeys: () => AuthHook<{ id: string; createdAt: Date }[]>; useIsRestoring?: () => boolean; };