@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/cjs/index.js
CHANGED
|
@@ -146,7 +146,7 @@ function isLoggedIn() {
|
|
|
146
146
|
function removeToken() {
|
|
147
147
|
let is_logged = isLoggedIn();
|
|
148
148
|
if (is_logged) {
|
|
149
|
-
|
|
149
|
+
callStorage('removeItem', "token");
|
|
150
150
|
}
|
|
151
151
|
is_logged = isLoggedIn();
|
|
152
152
|
if (is_logged) {
|
|
@@ -170,7 +170,7 @@ function requireToken() {
|
|
|
170
170
|
const tok = getToken();
|
|
171
171
|
if (!tok || isTokenExpired(tok)) {
|
|
172
172
|
console.warn("→ No token or expired token, redirecting to login…");
|
|
173
|
-
|
|
173
|
+
removeToken();
|
|
174
174
|
window.location.href = '/';
|
|
175
175
|
throw new Error("Redirecting to login…");
|
|
176
176
|
}
|