propro-utils 1.7.15 → 1.7.16

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.7.15",
3
+ "version": "1.7.16",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -101,21 +101,21 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
101
101
 
102
102
  // Domain configuration
103
103
  let domain;
104
- // try {
105
- // domain = appUrl ? new URL(appUrl).hostname : undefined;
106
- // if (domain?.includes('mapmap.app')) {
107
- // domain = '.mapmap.app';
108
- // }
109
- // if (domain?.includes('localhost')) {
110
- // domain = undefined;
111
- // }
112
- // if (domain?.includes('propro.so')) {
113
- // domain = 'propro.so';
114
- // }
115
- // } catch (error) {
116
- // console.error('Invalid appUrl:', { error, appUrl });
117
- // domain = undefined;
118
- // }
104
+ try {
105
+ domain = appUrl ? new URL(appUrl).hostname : undefined;
106
+ if (domain?.includes('mapmap.app')) {
107
+ domain = '.mapmap.app';
108
+ }
109
+ if (domain?.includes('localhost')) {
110
+ domain = undefined;
111
+ }
112
+ if (domain?.includes('propro.so')) {
113
+ domain = 'propro.so';
114
+ }
115
+ } catch (error) {
116
+ console.error('Invalid appUrl:', { error, appUrl });
117
+ domain = undefined;
118
+ }
119
119
 
120
120
  const commonAttributes = {
121
121
  secure: true,
@@ -143,11 +143,11 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
143
143
 
144
144
  const regularCookies = {
145
145
  user: {
146
- value: safeStringify(sanitizedUser),
146
+ value: 'xxx',// safeStringify(sanitizedUser),
147
147
  maxAge: refreshMaxAge,
148
148
  },
149
149
  account: {
150
- value: safeStringify(sanitizedAccount),
150
+ value: 'xxx',// safeStringify(sanitizedAccount),
151
151
  maxAge: refreshMaxAge,
152
152
  },
153
153
  has_account_token: {
@@ -164,7 +164,6 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
164
164
  res.cookie(name, config.value, {
165
165
  ...commonAttributes,
166
166
  ...config,
167
- domain: undefined
168
167
  });
169
168
  // console.log('Setting cookie 2:', {response})
170
169
  } catch (error) {