UNPKG

remix-auth-totp-dev

Version:

A Time-Based One-Time Password (TOTP) Authentication Strategy for Remix-Auth.

13 lines (12 loc) 424 B
export function redirect(url, init = 302) { let responseInit = init; if (typeof responseInit === "number") { responseInit = { status: responseInit }; } else if (typeof responseInit.status === "undefined") { responseInit.status = 302; } const headers = new Headers(responseInit.headers); headers.set("Location", url); return new Response(null, { ...responseInit, headers }); }