UNPKG

sk-oidc-oauth

Version:

OIDC/OAuth2 authentication and authorization for prerendered/client-side-rendered SvelteKit apps.

46 lines (45 loc) 1.46 kB
import { SvelteComponent } from "svelte"; declare const __propDef: { props: { /** Condition to pass the authorization check. */ passCondition: boolean; /** * Redirect to this path if the user is not authorized. * * @default '/' */ redirect?: string | undefined; /** * Component to render while loading/authenticating. * * @example * ```svelte * <div * class="flex h-full min-h-[calc(100dvh-4rem)] w-full flex-col items-center justify-center px-4 pb-16" * > * <h1 class="mt-5 text-3xl md:text-5xl">Authenticating...</h1> * </div> * ``` */ loadingComponent?: typeof SvelteComponent<any, any, any> | null | undefined; }; events: { [evt: string]: CustomEvent<any>; }; slots: { default: {}; }; }; export type AuthorizationGuardProps = typeof __propDef.props; export type AuthorizationGuardEvents = typeof __propDef.events; export type AuthorizationGuardSlots = typeof __propDef.slots; /** * Authorization wrapper. * * @example * ```svelte * <Authorization passCondition={$isAuthenticated && !$isLoading} redirect="/auth/login"> * <slot /> * </Authorization> * ``` */ export default class AuthorizationGuard extends SvelteComponent<AuthorizationGuardProps, AuthorizationGuardEvents, AuthorizationGuardSlots> { } export {};