@propelauth/nextjs
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -622,6 +622,3 @@ "use strict"; | ||
); | ||
headers3.append( | ||
"Set-Cookie", | ||
`${RETURN_TO_PATH_COOKIE_NAME}=; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=0` | ||
); | ||
headers3.append("Set-Cookie", getCookieForReturnToPathInCallback(returnToPathFromCookie)); | ||
return new Response(null, { | ||
@@ -647,6 +644,3 @@ status: 302, | ||
); | ||
headers2.append( | ||
"Set-Cookie", | ||
`${RETURN_TO_PATH_COOKIE_NAME}=; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=0` | ||
); | ||
headers2.append("Set-Cookie", getCookieForReturnToPathInCallback(returnToPathFromCookie)); | ||
return new Response(null, { | ||
@@ -987,6 +981,15 @@ status: 302, | ||
} | ||
function getCookieForReturnToPathInCallback(returnToPathFromCookie) { | ||
if (returnToPathFromCookie) { | ||
return `${RETURN_TO_PATH_COOKIE_NAME}=${returnToPathFromCookie}; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=15`; | ||
} else { | ||
return `${RETURN_TO_PATH_COOKIE_NAME}=; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=0`; | ||
} | ||
} | ||
function getCurrentPath() { | ||
const path = (0, import_headers.headers)().get(CUSTOM_HEADER_FOR_PATH); | ||
if (!path) { | ||
console.warn("Attempting to redirect to the current path, but we could not find the current path in the headers. Is the middleware set up?"); | ||
console.warn( | ||
"Attempting to redirect to the current path, but we could not find the current path in the headers. Is the middleware set up?" | ||
); | ||
return void 0; | ||
@@ -1001,3 +1004,5 @@ } else { | ||
if (!url) { | ||
console.warn("Attempting to redirect to the current URL, but we could not find the current URL in the headers. Is the middleware set up?"); | ||
console.warn( | ||
"Attempting to redirect to the current URL, but we could not find the current URL in the headers. Is the middleware set up?" | ||
); | ||
return void 0; | ||
@@ -1004,0 +1009,0 @@ } else { |
{ | ||
"name": "@propelauth/nextjs", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"exports": { | ||
@@ -5,0 +5,0 @@ "./server": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
604573
6417