UNPKG

@light-auth/nuxt

Version:

light auth framework for nuxt, using arctic

22 lines (21 loc) 1.45 kB
import { type LightAuthConfig, type LightAuthSession, type LightAuthUser } from "@light-auth/core"; import { type EventHandlerRequest, H3Event } from "h3"; /** * CreateLightAuth is a function that creates the LightAuth components for Nuxt.js. * It takes a LightAuthConfig object as a parameter and returns a LightAuthNuxtJsComponents object. * The function also sets default values for the userAdapter, router and cookieStore if they are not provided. */ export declare function CreateLightAuth<Session extends LightAuthSession = LightAuthSession, User extends LightAuthUser<Session> = LightAuthUser<Session>>(config: LightAuthConfig<Session, User>): { providers: import("@light-auth/core").LightAuthProvider[]; handlers: { GET: any; POST: any; }; basePath: string; signIn: (event: H3Event<EventHandlerRequest>, providerName?: string, callbackUrl?: string) => Promise<void>; signOut: (event: H3Event<EventHandlerRequest>, revokeToken?: boolean, callbackUrl?: string) => Promise<void>; getAuthSession: (event: H3Event<EventHandlerRequest>) => Promise<Session | null | undefined>; setAuthSession: (event: H3Event<EventHandlerRequest>, session: Session) => Promise<Session | null | undefined>; getUser: (event: H3Event<EventHandlerRequest>, providerUserId?: string) => Promise<User | null>; setUser: (event: H3Event<EventHandlerRequest>, user: User) => Promise<User | null | undefined>; };