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