l-min-components 1.7.1371 → 1.7.1373
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 +1 -1
- package/src/components/AppMainLayout/index.jsx +2 -10
- package/src/components/instructorAccountSwitcher/deleteCookies.jsx +0 -3
- package/src/components/instructorAccountSwitcher/index.jsx +1 -5
- package/src/components/sideBar/userCard/index.jsx +3 -15
- package/src/utils/deleteCookies.js +2 -14
package/package.json
CHANGED
|
@@ -161,20 +161,12 @@ const AppMainLayout = ({ children }) => {
|
|
|
161
161
|
document.cookie =
|
|
162
162
|
"defaultAccountID=" +
|
|
163
163
|
getDefaultAccount?.data?.id +
|
|
164
|
-
`;
|
|
165
|
-
window.location.href.includes("localhost")
|
|
166
|
-
? ".localhost"
|
|
167
|
-
: ".learngual.com"
|
|
168
|
-
}; path=/; expires=${date.toUTCString()};`;
|
|
164
|
+
`; path=/; expires=${date.toUTCString()};`;
|
|
169
165
|
|
|
170
166
|
document.cookie =
|
|
171
167
|
"defaultAccountType=" +
|
|
172
168
|
getDefaultAccount?.data?.type +
|
|
173
|
-
`;
|
|
174
|
-
window.location.href.includes("localhost")
|
|
175
|
-
? ".localhost"
|
|
176
|
-
: ".learngual.com"
|
|
177
|
-
}; path=/; expires=${date.toUTCString()};`;
|
|
169
|
+
`; path=/; expires=${date.toUTCString()};`;
|
|
178
170
|
|
|
179
171
|
localStorage.setItem("defaultLang", getDefaultAccount?.data?.language);
|
|
180
172
|
|
|
@@ -11,19 +11,16 @@ const deleteCookies = (name) => {
|
|
|
11
11
|
: "production";
|
|
12
12
|
if (env === "staging") {
|
|
13
13
|
Cookies.remove(name, {
|
|
14
|
-
domain: ".learngual.com",
|
|
15
14
|
expires: date,
|
|
16
15
|
path: "/",
|
|
17
16
|
});
|
|
18
17
|
} else if (env === "local") {
|
|
19
18
|
Cookies.remove(name, {
|
|
20
|
-
domain: ".localhost",
|
|
21
19
|
expires: date,
|
|
22
20
|
path: "/",
|
|
23
21
|
});
|
|
24
22
|
} else {
|
|
25
23
|
Cookies.remove(name, {
|
|
26
|
-
domain: ".learngual.com",
|
|
27
24
|
expires: date,
|
|
28
25
|
path: "/",
|
|
29
26
|
});
|
|
@@ -70,12 +70,8 @@ const InstructorAccountSwitcher = ({
|
|
|
70
70
|
const date = new Date();
|
|
71
71
|
date.setDate(date.getDate() + 20);
|
|
72
72
|
const expires = "; expires=" + date.toUTCString();
|
|
73
|
-
const domain = window.location.href.includes("localhost")
|
|
74
|
-
? ".localhost"
|
|
75
|
-
: ".learngual.com";
|
|
76
73
|
const path = "; path=/";
|
|
77
|
-
document.cookie =
|
|
78
|
-
"affiliateAccount=" + id + expires + "; domain=" + domain + path;
|
|
74
|
+
document.cookie = "affiliateAccount=" + id + expires + path;
|
|
79
75
|
};
|
|
80
76
|
|
|
81
77
|
const cookieValue = getCookie();
|
|
@@ -24,27 +24,15 @@ const UserCard = ({ isOpen, findText }) => {
|
|
|
24
24
|
document.cookie =
|
|
25
25
|
"activeDeveloperAccount=" +
|
|
26
26
|
generalData?.selectedAccount?.id +
|
|
27
|
-
`;
|
|
28
|
-
window.location.href.includes("localhost")
|
|
29
|
-
? ".localhost"
|
|
30
|
-
: ".learngual.com"
|
|
31
|
-
}; path=/; expires=${date.toUTCString()};`;
|
|
27
|
+
`; path=/; expires=${date.toUTCString()};`;
|
|
32
28
|
document.cookie =
|
|
33
29
|
"defaultAccountID=" +
|
|
34
30
|
generalData?.selectedAccount?.id +
|
|
35
|
-
`;
|
|
36
|
-
window.location.href.includes("localhost")
|
|
37
|
-
? ".localhost"
|
|
38
|
-
: ".learngual.com"
|
|
39
|
-
}; path=/; expires=${date.toUTCString()};`;
|
|
31
|
+
`; path=/; expires=${date.toUTCString()};`;
|
|
40
32
|
document.cookie =
|
|
41
33
|
"defaultAccountType=" +
|
|
42
34
|
generalData?.selectedAccount?.type +
|
|
43
|
-
`;
|
|
44
|
-
window.location.href.includes("localhost")
|
|
45
|
-
? ".localhost"
|
|
46
|
-
: ".learngual.com"
|
|
47
|
-
}; path=/; expires=${date.toUTCString()};`;
|
|
35
|
+
`; path=/; expires=${date.toUTCString()};`;
|
|
48
36
|
|
|
49
37
|
handleSetDefaultAccount(generalData?.selectedAccount?.id);
|
|
50
38
|
|
|
@@ -16,7 +16,7 @@ const deleteSingleCookie = (name, options) => {
|
|
|
16
16
|
const deleteCookies = (names) => {
|
|
17
17
|
// Convert single name to array for consistent handling
|
|
18
18
|
const cookieNames = Array.isArray(names) ? names : [names];
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
const date = new Date();
|
|
21
21
|
date.setHours(date.getHours() - 1);
|
|
22
22
|
const { host } = window.location;
|
|
@@ -27,28 +27,16 @@ const deleteCookies = (names) => {
|
|
|
27
27
|
: "production";
|
|
28
28
|
|
|
29
29
|
// Process each cookie name
|
|
30
|
-
cookieNames.forEach(name => {
|
|
30
|
+
cookieNames.forEach((name) => {
|
|
31
31
|
if (env === "local") {
|
|
32
32
|
// For local environment
|
|
33
|
-
const localDomains = [".localhost", "localhost"];
|
|
34
|
-
localDomains.forEach(domain => {
|
|
35
|
-
deleteSingleCookie(name, {
|
|
36
|
-
domain,
|
|
37
|
-
expires: date,
|
|
38
|
-
path: "/",
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
// Also delete without domain specification for local testing
|
|
42
33
|
deleteSingleCookie(name, {
|
|
43
34
|
expires: date,
|
|
44
35
|
path: "/",
|
|
45
36
|
});
|
|
46
37
|
} else {
|
|
47
38
|
// For staging and production environments
|
|
48
|
-
const domain = ".learngual.com";
|
|
49
|
-
// Delete for main domain and all potential subdomains
|
|
50
39
|
deleteSingleCookie(name, {
|
|
51
|
-
domain,
|
|
52
40
|
expires: date,
|
|
53
41
|
path: "/",
|
|
54
42
|
});
|