acsi-core 1.2.21 → 1.2.22
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/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +5 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -2486,7 +2486,6 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
|
|
|
2486
2486
|
if (data.success) {
|
|
2487
2487
|
localStorage.clear();
|
|
2488
2488
|
var tokenJWT = data.data.token;
|
|
2489
|
-
localStorage.setItem(ACCESS_TOKEN, tokenJWT);
|
|
2490
2489
|
trackEvent === null || trackEvent === void 0 ? void 0 : trackEvent({
|
|
2491
2490
|
eventName: AmplitudeEvent.LOGIN,
|
|
2492
2491
|
eventProperties: {
|
|
@@ -2498,12 +2497,17 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
|
|
|
2498
2497
|
var isRootDomain = window.location.hostname === REQUEST_ORIGIN || window.location.hostname === "www." + REQUEST_ORIGIN;
|
|
2499
2498
|
if (isRootDomain) {
|
|
2500
2499
|
var _data$data$roles;
|
|
2500
|
+
CookieService.setAuthCookie({
|
|
2501
|
+
token: tokenJWT,
|
|
2502
|
+
expiresAt: Date.now() + 24 * 60 * 60 * 1000
|
|
2503
|
+
});
|
|
2501
2504
|
var domain = TEACHER_ORIGIN;
|
|
2502
2505
|
if ((_data$data$roles = data.data.roles) !== null && _data$data$roles !== void 0 && _data$data$roles.includes("Admin")) {
|
|
2503
2506
|
domain = ADMIN_ORIGIN;
|
|
2504
2507
|
}
|
|
2505
2508
|
window.location.href = domain + "/dashboard";
|
|
2506
2509
|
} else {
|
|
2510
|
+
localStorage.setItem(ACCESS_TOKEN, tokenJWT);
|
|
2507
2511
|
onNavigate("/dashboard");
|
|
2508
2512
|
}
|
|
2509
2513
|
} else {
|