UNPKG

@vaadin/hilla-file-router

Version:

Hilla file-based router

12 lines (11 loc) 473 B
import type { RouteTransformer } from "./utils.js"; /** * Creates a route transformer that applies route protection to a given route, * optionally redirecting unauthorized access to a specified path. * * @param redirectPath - Optional path to redirect unauthorized users to. * Defaults to '/login'. * * @returns A route transformer function that applies protection to the route. */ export default function createProtectTransformer(redirectPath?: string): RouteTransformer;