propro-utils 1.7.16 → 1.7.18

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.16",
3
+ "version": "1.7.18",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -104,13 +104,13 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
104
104
  try {
105
105
  domain = appUrl ? new URL(appUrl).hostname : undefined;
106
106
  if (domain?.includes('mapmap.app')) {
107
- domain = '.mapmap.app';
107
+ domain = 'https://mapmap.app';
108
108
  }
109
109
  if (domain?.includes('localhost')) {
110
110
  domain = undefined;
111
111
  }
112
112
  if (domain?.includes('propro.so')) {
113
- domain = 'propro.so';
113
+ domain = 'https://propro.so';
114
114
  }
115
115
  } catch (error) {
116
116
  console.error('Invalid appUrl:', { error, appUrl });
@@ -143,11 +143,11 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
143
143
 
144
144
  const regularCookies = {
145
145
  user: {
146
- value: 'xxx',// safeStringify(sanitizedUser),
146
+ value: safeStringify(sanitizedUser),
147
147
  maxAge: refreshMaxAge,
148
148
  },
149
149
  account: {
150
- value: 'xxx',// safeStringify(sanitizedAccount),
150
+ value: safeStringify(sanitizedAccount),
151
151
  maxAge: refreshMaxAge,
152
152
  },
153
153
  has_account_token: {
@@ -160,7 +160,7 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
160
160
  Object.entries({ ...httpOnlyCookies, ...regularCookies }).forEach(
161
161
  ([name, config]) => {
162
162
  try{
163
- console.log(domain,'Setting cookie 1:', {name, value: config.value})
163
+ console.log(domain,'Setting cookie 1:', {name, value: config.value, commonAttributes, config})
164
164
  res.cookie(name, config.value, {
165
165
  ...commonAttributes,
166
166
  ...config,