@alba-cars/common-modules 1.4.2 → 1.4.3
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.
|
@@ -161,6 +161,9 @@ exports.UTIL_ENDPOINTS = {
|
|
|
161
161
|
media: {
|
|
162
162
|
createS3Url: "/utils/get-upload-url",
|
|
163
163
|
preprocessMediaUrl: "/utils/process-media",
|
|
164
|
+
removeS3Media: '/utils/remove-s3',
|
|
165
|
+
removeVehicleMedia: '/utils/remove-vehcile-media',
|
|
166
|
+
removeByIdentifier: '/utils/remove-by-identifier'
|
|
164
167
|
},
|
|
165
168
|
};
|
|
166
169
|
exports.AUTH_ENDPOINTS = {
|
|
@@ -10,18 +10,23 @@ const BASE_URL = process.env.NEXT_PUBLIC_API_URL;
|
|
|
10
10
|
const AUTH_STORAGE_KEY = "auth_tokens";
|
|
11
11
|
let isRefreshing = false;
|
|
12
12
|
let refreshSubscribers = [];
|
|
13
|
+
const isServer = typeof window === "undefined";
|
|
13
14
|
const getTokens = () => {
|
|
14
|
-
if (
|
|
15
|
+
if (isServer)
|
|
15
16
|
return null;
|
|
16
17
|
const tokens = localStorage.getItem(AUTH_STORAGE_KEY);
|
|
17
18
|
return tokens ? JSON.parse(tokens) : null;
|
|
18
19
|
};
|
|
19
20
|
exports.getTokens = getTokens;
|
|
20
21
|
const setTokens = (tokens) => {
|
|
22
|
+
if (isServer)
|
|
23
|
+
return;
|
|
21
24
|
localStorage.setItem(AUTH_STORAGE_KEY, JSON.stringify(tokens));
|
|
22
25
|
};
|
|
23
26
|
exports.setTokens = setTokens;
|
|
24
27
|
const removeTokens = () => {
|
|
28
|
+
if (isServer)
|
|
29
|
+
return;
|
|
25
30
|
localStorage.removeItem(AUTH_STORAGE_KEY);
|
|
26
31
|
};
|
|
27
32
|
exports.removeTokens = removeTokens;
|
package/package.json
CHANGED