propro-utils 1.7.25 → 1.7.26

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.25",
3
+ "version": "1.7.26",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "private": false,
@@ -101,9 +101,7 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
101
101
  // Domain configuration
102
102
  let domain;
103
103
  try {
104
- console.log('** APP URL', appUrl)
105
104
  domain = appUrl ? new URL(appUrl).hostname : undefined;
106
- console.log('** DOMAIN', domain)
107
105
  if (domain?.includes('mapmap.app')) {
108
106
  domain = '.mapmap.app';
109
107
  }
@@ -114,7 +112,6 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
114
112
  domain = 'propro.so';
115
113
  }
116
114
  } catch (error) {
117
- console.log('** ERROR', error)
118
115
  console.error('Invalid appUrl:', { error, appUrl });
119
116
  domain = undefined;
120
117
  }
@@ -126,10 +123,6 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
126
123
  path: '/',
127
124
  };
128
125
 
129
- console.log('** MAX AGES', {
130
- refreshMaxAge,
131
- accessMaxAge
132
- })
133
126
  const httpOnlyCookies = {
134
127
  'x-refresh-token': {
135
128
  value: tokens.refresh.token,
@@ -145,7 +138,7 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
145
138
 
146
139
  const sanitizedUser = sanitizeUser(user);
147
140
  const sanitizedAccount = { ...account };
148
- delete sanitizedAccount?.passwordHistory;
141
+ delete sanitizedAccount.passwordHistory;
149
142
 
150
143
  const regularCookies = {
151
144
  user: {
@@ -162,11 +155,6 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
162
155
  },
163
156
  };
164
157
 
165
- console.log('** SURVIVED OBJECTIFYING COOKIES', {
166
- httpOnlyCookies,
167
- regularCookies,
168
- })
169
-
170
158
  try {
171
159
  Object.entries({ ...httpOnlyCookies, ...regularCookies }).forEach(
172
160
  ([name, config]) => {
@@ -177,7 +165,6 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
177
165
  }
178
166
  );
179
167
 
180
- /*
181
168
  const extensionCookiePromises = Object.entries({
182
169
  ...httpOnlyCookies,
183
170
  ...regularCookies,
@@ -196,7 +183,6 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
196
183
  });
197
184
 
198
185
  await Promise.allSettled(extensionCookiePromises);
199
- */
200
186
 
201
187
  console.log('Auth cookies set successfully', {
202
188
  domain,