How to use the found.RedirectException function in found

To help you get started, we’ve selected a few found examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github artsy / reaction / src / Apps / Order / routes.tsx View on Github external
if (order) {
          const redirect = getRedirect(
            redirects,
            location.pathname.replace(/order(2|s)\/[^\/]+/, ""),
            { order }
          )
          if (redirect !== null) {
            if (process.env.NODE_ENV === "development") {
              console.error(
                `Redirecting from ${location.pathname} to ${
                  redirect.path
                } because '${redirect.reason}'`
              )
            }
            throw new RedirectException(redirect.path)
          }
        }

        return 
      }
    },
    children: [
github artsy / reaction / src / Apps / Auction / routes.tsx View on Github external
function handleRedirect(redirect: Redirect, location: Location) {
  if (redirect) {
    logger.warn(
      `Redirecting from ${location.pathname} to ${redirect.path} because '${
        redirect.reason
      }'`
    )
    throw new RedirectException(redirect.path)
  }
}
github artsy / reaction / dist / Apps / Auction / routes.js View on Github external
function handleRedirect(redirect, location) {
  if (redirect) {
    logger.warn("Redirecting from ".concat(location.pathname, " to ").concat(redirect.path, " because '").concat(redirect.reason, "'"));
    throw new _found.RedirectException(redirect.path);
  }
}
//# sourceMappingURL=routes.js.map