@putkoff/abstract-utilities 0.1.211 → 0.1.212
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/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -143,7 +143,7 @@ function isLoggedIn() {
|
|
|
143
143
|
function removeToken() {
|
|
144
144
|
let is_logged = isLoggedIn();
|
|
145
145
|
if (is_logged) {
|
|
146
|
-
|
|
146
|
+
callStorage('removeItem', "token");
|
|
147
147
|
}
|
|
148
148
|
is_logged = isLoggedIn();
|
|
149
149
|
if (is_logged) {
|
|
@@ -167,7 +167,7 @@ function requireToken() {
|
|
|
167
167
|
const tok = getToken();
|
|
168
168
|
if (!tok || isTokenExpired(tok)) {
|
|
169
169
|
console.warn("→ No token or expired token, redirecting to login…");
|
|
170
|
-
|
|
170
|
+
removeToken();
|
|
171
171
|
window.location.href = '/';
|
|
172
172
|
throw new Error("Redirecting to login…");
|
|
173
173
|
}
|