import { Notify } from "../notify/Notify";
import { BaseError } from "../base/BaseError";
import { translate } from "@/plugins/i18n";
// import { useAuthStore } from "@/modules/auth/store/AuthStore";
// import pinia from "@/store";

// const authStore=useAuthStore(pinia);
export class UnAuthenticatedError extends BaseError {
  message = translate("errorMessages.UnAuthenticatedError");
  sessionExpiredMessage = "Session Expired, Please Login Again";
  requiresAuthMessage = "Please Login To Your Account First.";
  //TODO handle logout/storage clear cases
  // dispatchError() {
    // if (authStore.isAuthenticated) {
    //   //case the token lifetime has expired
    //   Notify.showMessage("warning", this.sessionExpiredMessage);
    // } else {//case no token is stored
    //   Notify.showMessage("error", this.requiresAuthMessage);
    // }
    // authStore.localLogout();
  // }
}
