l-min-components 1.0.1020 → 1.0.1022
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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Cookies from "js-cookie";
|
|
2
|
+
|
|
3
|
+
const deleteCookies = (name) => {
|
|
4
|
+
const date = new Date();
|
|
5
|
+
date.setHours(date.getHours() - 1);
|
|
6
|
+
const { host } = window.location;
|
|
7
|
+
const env = host.includes("localhost")
|
|
8
|
+
? "local"
|
|
9
|
+
: host.includes("test") || host.includes("staging")
|
|
10
|
+
? "staging"
|
|
11
|
+
: "production";
|
|
12
|
+
if (env === "staging") {
|
|
13
|
+
Cookies.remove(name, {
|
|
14
|
+
domain: ".learngual.com",
|
|
15
|
+
expires: date,
|
|
16
|
+
path: "/",
|
|
17
|
+
});
|
|
18
|
+
} else if (env === "local") {
|
|
19
|
+
Cookies.remove(name, {
|
|
20
|
+
domain: ".localhost",
|
|
21
|
+
expires: date,
|
|
22
|
+
path: "/",
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
Cookies.remove(name, {
|
|
26
|
+
domain: ".learngual.com",
|
|
27
|
+
expires: date,
|
|
28
|
+
path: "/",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default deleteCookies;
|
|
@@ -8,7 +8,7 @@ import RenewModal from "./components/renew modal";
|
|
|
8
8
|
import useHeader from "../header/getHeaderDetails";
|
|
9
9
|
import OutsideAlerter from "../outsideEventChecker";
|
|
10
10
|
import FullPageLoader from "../fullPageLoader";
|
|
11
|
-
import deleteCookies from "
|
|
11
|
+
import deleteCookies from "./deleteCookies";
|
|
12
12
|
|
|
13
13
|
const InstructorAccountSwitcher = ({
|
|
14
14
|
setAccountType,
|