acsi-core 0.1.60 → 0.1.62

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 CHANGED
@@ -263,11 +263,8 @@ var BlockLogin = function BlockLogin(_ref) {
263
263
  alert("Please contact admin.");
264
264
  return;
265
265
  }
266
+ localStorage.clear();
266
267
  var tokenJWT = authResult.data.token;
267
- CookieService.setAuthCookie({
268
- token: tokenJWT,
269
- expiresAt: Date.now() + 24 * 60 * 60 * 1000
270
- });
271
268
  trackEvent === null || trackEvent === void 0 ? void 0 : trackEvent({
272
269
  eventName: exports.AmplitudeEvent.LOGIN,
273
270
  eventProperties: {
@@ -279,6 +276,10 @@ var BlockLogin = function BlockLogin(_ref) {
279
276
  }
280
277
  });
281
278
  if (role === "LandingPage") {
279
+ CookieService.setAuthCookie({
280
+ token: tokenJWT,
281
+ expiresAt: Date.now() + 24 * 60 * 60 * 1000
282
+ });
282
283
  var getRedirectUrl = function getRedirectUrl(role) {
283
284
  switch (role) {
284
285
  case "Admin":
@@ -604,6 +605,7 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
604
605
  })).then(function (res) {
605
606
  var data = res.data;
606
607
  if (data.status == 1) {
608
+ localStorage.clear();
607
609
  var tokenJWT = data.data.token;
608
610
  localStorage.setItem(ACCESS_TOKEN, tokenJWT);
609
611
  trackEvent === null || trackEvent === void 0 ? void 0 : trackEvent({
@@ -617,7 +619,7 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
617
619
  onNavigate("/dashboard");
618
620
  } else {
619
621
  dispatch(setLoading(false));
620
- alert("The code is not accurate. Please check again.");
622
+ alert("The code is not correct. Please check again.");
621
623
  }
622
624
  });
623
625
  }, function (e) {
@@ -1078,10 +1080,7 @@ var useGoogleSignOut = function useGoogleSignOut(props) {
1078
1080
  signOut = _useGoogleLogout.signOut,
1079
1081
  loaded = _useGoogleLogout.loaded;
1080
1082
  var handleSignOut = function handleSignOut() {
1081
- localStorage.removeItem("USER_INFORMATION");
1082
- localStorage.removeItem(ACCESS_TOKEN);
1083
- localStorage.removeItem(ORGANIZATION_TENANT);
1084
- localStorage.removeItem(ORGANIZATION_TEAM);
1083
+ localStorage.clear();
1085
1084
  try {
1086
1085
  signOut();
1087
1086
  } catch (error) {