Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "fred-jwt", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
@@ -21,3 +21,3 @@ import "@babel/polyfill"; | ||
const asyncHandler = async (event) => { | ||
const { queryStringParameters, requestContext, rawPath } = event; | ||
const { queryStringParameters, requestContext, rawPath, headers } = event; | ||
@@ -36,5 +36,6 @@ const { code, logout: lo, refresh } = queryStringParameters; | ||
const AUTH_ENDPOINT = apps[APP_DOMAIN].authEndpoint; | ||
const AUTH_CALLBACK_URL = `https://${domainName}${rawPath}`; | ||
const AUTH_PROTOCOL = headers['x-forwarded-proto']; | ||
const AUTH_CALLBACK_URL = `${AUTH_PROTOCOL}://${domainName}${rawPath}`; | ||
const FRED_JWT_COOKIE_DOMAIN = `.${APP_DOMAIN}`; | ||
const FRED_JWT_COOKIE_DOMAIN = `.${APP_DOMAIN.split(':')[0]}`; | ||
@@ -49,3 +50,3 @@ const AUTH_LOGIN_URL = `${AUTH_ENDPOINT}/authorize?` + | ||
`client_id=${AUTH_CLIENT_ID}&` + | ||
`logout_uri=https://${APP_DOMAIN}`; | ||
`logout_uri=${AUTH_PROTOCOL}://${APP_DOMAIN}`; | ||
@@ -55,3 +56,3 @@ if (AUTH_ENDPOINT.includes('auth0')){ | ||
`client_id=${AUTH_CLIENT_ID}&` + | ||
`returnTo=https://${APP_DOMAIN}` | ||
`returnTo=${AUTH_PROTOCOL}://${APP_DOMAIN}` | ||
} | ||
@@ -111,3 +112,3 @@ | ||
headers: { | ||
location: `https://fred.${APP_DOMAIN}`, | ||
location: `${AUTH_PROTOCOL}://fred.${APP_DOMAIN}`, | ||
} | ||
@@ -114,0 +115,0 @@ };; |
Sorry, the diff of this file is too big to display
327035
255