@bostonuniversity/shibboleth-sp 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -69609,13 +69609,13 @@ var JwtTools = class _JwtTools {
69609
69609
  const maxAge = Math.floor(dist_default(this.expiresIn) / 1e3);
69610
69610
  response.headers["set-cookie"] = [{
69611
69611
  key: "Set-Cookie",
69612
- value: `${_JwtTools.COOKIE_NAME}=${jwtToken}; Max-Age=${maxAge}; Secure; HttpOnly`
69612
+ value: `${_JwtTools.COOKIE_NAME}=${jwtToken}; Max-Age=${maxAge}; Path=/; Secure; HttpOnly`
69613
69613
  }];
69614
69614
  }
69615
69615
  setCookieInvalidationInResponse(response) {
69616
69616
  response.headers["set-cookie"] = [{
69617
69617
  key: "Set-Cookie",
69618
- value: `${_JwtTools.COOKIE_NAME}=invalidated; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Secure; HttpOnly`
69618
+ value: `${_JwtTools.COOKIE_NAME}=invalidated; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Path=/; Secure; HttpOnly`
69619
69619
  }];
69620
69620
  }
69621
69621
  getCookieName() {
@@ -69845,12 +69845,13 @@ var handler = async (originRequest, config) => {
69845
69845
  const qsparms = querystring ? new URLSearchParams(querystring) : null;
69846
69846
  console.log(`uri: ${uri}`);
69847
69847
  console.log(`querystring parameters: ${qsparms ? [...qsparms.keys()].join(", ") : ""}`);
69848
- const { LOGIN, LOGOUT, ASSERT, METADATA } = AUTH_PATHS;
69848
+ const { loginPath: LOGIN = "/login" /* LOGIN */, logoutPath: LOGOUT = "/logout" /* LOGOUT */ } = config;
69849
+ const { ASSERT, METADATA } = AUTH_PATHS;
69849
69850
  const getAppLoginUrl = () => {
69850
69851
  const relay_state = encodeURIComponent(relayDomain + uri + (querystring ? `?${querystring}` : ""));
69851
- return `${relayDomain}${"/login" /* LOGIN */}?relay_state=${relay_state}`;
69852
+ return `${relayDomain}${LOGIN}?relay_state=${relay_state}`;
69852
69853
  };
69853
- const getAppLogoutUrl = () => `${relayDomain}${"/logout" /* LOGOUT */}`;
69854
+ const getAppLogoutUrl = () => `${relayDomain}${LOGOUT}`;
69854
69855
  switch (uri) {
69855
69856
  case LOGIN:
69856
69857
  console.log("User is not authenticated, initiate SAML authentication...");
@@ -69882,7 +69883,7 @@ var handler = async (originRequest, config) => {
69882
69883
  status: "302",
69883
69884
  statusDescription: "Found",
69884
69885
  headers: {
69885
- location: [{ key: "Location", value: `${relayDomain}/logout?target=idp` }]
69886
+ location: [{ key: "Location", value: `${relayDomain}${LOGOUT}?target=idp` }]
69886
69887
  }
69887
69888
  };
69888
69889
  jwtTools.setCookieInvalidationInResponse(response);
@@ -70054,6 +70055,8 @@ var getConfigFromEnvironment = () => {
70054
70055
  APP_LOGIN_HEADER: appLoginHeader,
70055
70056
  APP_LOGOUT_HEADER: appLogoutHeader,
70056
70057
  APP_AUTHORIZATION: appAuthorization = "false",
70058
+ LOGIN_PATH: loginPath,
70059
+ LOGOUT_PATH: logoutPath,
70057
70060
  ENTITY_ID: entityId,
70058
70061
  ENTRY_POINT: entryPoint,
70059
70062
  LOGOUT_URL: logoutUrl,
@@ -70074,6 +70077,8 @@ var getConfigFromEnvironment = () => {
70074
70077
  appLogoutHeader,
70075
70078
  jwtPrivateKeyPEM,
70076
70079
  jwtPublicKeyPEM,
70080
+ loginPath,
70081
+ logoutPath,
70077
70082
  appAuthorization: `${appAuthorization}`.toLowerCase() == "false" ? false : true,
70078
70083
  samlParms: {
70079
70084
  entityId,