propro-utils 1.6.5 → 1.6.6

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.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -119,7 +119,12 @@ const setAuthCookies = async (res, tokens, account, user, appUrl) => {
119
119
  domain = undefined;
120
120
  }
121
121
  if (domain?.includes("propro.so")) {
122
- domain = "propro.so";
122
+ // Handle both main domain and subdomains of propro.so
123
+ if (domain.startsWith("short.")) {
124
+ domain = "short.propro.so";
125
+ } else {
126
+ domain = "propro.so";
127
+ }
123
128
  }
124
129
  } catch (error) {
125
130
  console.error("Invalid appUrl:", { error, appUrl });
@@ -238,6 +243,14 @@ const clearAuthCookies = async (res, appUrl) => {
238
243
  if (domain?.includes("localhost")) {
239
244
  domain = undefined;
240
245
  }
246
+ if (domain?.includes("propro.so")) {
247
+ // Handle both main domain and subdomains of propro.so
248
+ if (domain.startsWith("short.")) {
249
+ domain = "short.propro.so";
250
+ } else {
251
+ domain = "propro.so";
252
+ }
253
+ }
241
254
  } catch (error) {
242
255
  console.error("Invalid appUrl:", error);
243
256
  domain = undefined;