@kentcdodds/tmp-remix-utils
Version:
This package contains simple utility functions to use with [Remix.run](https://remix.run).
14 lines (13 loc) • 485 B
TypeScript
/**
* This should be used any time the redirect path is user-provided
* (Like the query string on our login/signup pages). This avoids
* open-redirect vulnerabilities.
* @param {string} to The redirect destination
* @param {string} defaultRedirect The redirect to use if the to is unsafe.
* @license MIT
* @author https://github.com/jacob-ebey
*/
export declare function safeRedirect(
to: FormDataEntryValue | string | null | undefined,
defaultRedirect?: string
): string;