propro-utils 1.4.54 → 1.4.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.4.54",
3
+ "version": "1.4.56",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -123,9 +123,9 @@ function proproAuthMiddleware(options = {}, userSchema) {
123
123
 
124
124
  const user = await checkIfUserExists(userSchema, account.accountId);
125
125
 
126
- setAuthCookies(res, tokens, account, user, appUrl);
126
+ setAuthCookies(res, tokens, account, user, redirectUrl);
127
127
 
128
- const urlToRedirect = formatRedirectUrl(appUrl);
128
+ const urlToRedirect = formatRedirectUrl(redirectUrl);
129
129
 
130
130
  return res.redirect(urlToRedirect);
131
131
  }
@@ -19,7 +19,7 @@ const setAuthCookies = (res, tokens, account, user, appUrl) => {
19
19
  secure: process.env.NODE_ENV === 'production',
20
20
  // sameSite: 'Strict',
21
21
  // path: '/',
22
- domain: redirectUri ? new URL(appUrl).hostname : undefined,
22
+ domain: appUrl ? new URL(appUrl).hostname : undefined,
23
23
  };
24
24
 
25
25
  res.cookie('x-refresh-token', tokens.refresh.token, {