import { LoaderFunctionArgs } from 'react-router'; import { GetAuthURLResult, NoUserInfo, UserInfo } from './interfaces.js'; /** * Build a sign-in URL and the short-lived PKCE / CSRF cookie that must travel * back to the browser on the redirect. * * Pass `request` when calling from a loader so the cookie's `Secure` * attribute matches the live protocol (important for local dev on * `http://` against an `https://` redirect URI). * * @example * export async function loader({ request }: LoaderFunctionArgs) { * const { url, headers } = await getSignInUrl('/dashboard', request); * return redirect(url, { headers }); * } */ export declare function getSignInUrl(returnPathname?: string, request?: Request): Promise; /** * Build a sign-up URL and the short-lived PKCE / CSRF cookie that must travel * back to the browser on the redirect. * * Pass `request` when calling from a loader so the cookie's `Secure` * attribute matches the live protocol. * * @example * export async function loader({ request }: LoaderFunctionArgs) { * const { url, headers } = await getSignUpUrl('/welcome', request); * return redirect(url, { headers }); * } */ export declare function getSignUpUrl(returnPathname?: string, request?: Request): Promise; export declare function signOut(request: Request, options?: { returnTo?: string; }): Promise; /** * Given a loader's args, this function will check if the user is authenticated. * If the user is authenticated, it will return their information. * If the user is not authenticated, it will return an object with user set to null. * IMPORTANT: This authkitLoader must be used in a parent/root loader * to handle session refresh and cookie management. * @param args - The loader's arguments. * @returns An object containing user information */ export declare function withAuth(args: LoaderFunctionArgs): Promise; /** * Switches the current session to a different organization. * @param request - The incoming request object. * @param organizationId - The ID of the organization to switch to. * @param options - Optional parameters. `returnTo` must be a same-origin * pathname (e.g. `/dashboard`); anything else redirects to `/`. * @returns A redirect response to the specified returnTo path or a data response with the updated auth data. */ export declare function switchToOrganization(request: Request, organizationId: string, { returnTo }?: { returnTo?: string; }): Promise | import("react-router").UNSAFE_DataWithResponseInit<{ success: boolean; error: string; }>>;