propro-utils 1.4.63 → 1.4.65

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.63",
3
+ "version": "1.4.65",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -128,13 +128,7 @@ function proproAuthMiddleware(options = {}, userSchema) {
128
128
  const setCookies = res.getHeader('Set-Cookie');
129
129
  console.log('Set-Cookies: ', setCookies);
130
130
 
131
- res.on('finish', () => {
132
- const urlToRedirect = formatRedirectUrl(redirectUrl);
133
- console.log('Redirecting to: ', urlToRedirect);
134
- res.redirect(urlToRedirect);
135
- });
136
-
137
- res.end();
131
+ return res.redirect(redirectUrl);
138
132
  }
139
133
  } catch (error) {
140
134
  console.log('Unauthorized: ', error.message);
@@ -17,7 +17,7 @@ const setAuthCookies = (res, tokens, account, user, appUrl) => {
17
17
 
18
18
  const commonAttributes = {
19
19
  secure: process.env.NODE_ENV === 'production',
20
- sameSite: 'Strict',
20
+ sameSite: 'None',
21
21
  // path: '/',
22
22
  domain: appUrl ? new URL(appUrl).hostname : undefined,
23
23
  };