@nitra/vite-boot 2.1.6 → 2.1.7
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/package.json +1 -1
- package/src/token.js +3 -2
package/package.json
CHANGED
package/src/token.js
CHANGED
|
@@ -38,8 +38,9 @@ export const refreshToken = async () => {
|
|
|
38
38
|
localStorage.setItem('token', result.token)
|
|
39
39
|
// та перезавантажуємо щоб він вступив в дію
|
|
40
40
|
|
|
41
|
-
// Якщо ми на сторінці логіну
|
|
42
|
-
|
|
41
|
+
// Якщо ми на сторінці логіну або логауту
|
|
42
|
+
const awayFrom = ['/login', '/logout']
|
|
43
|
+
if (awayFrom.includes(window.location.pathname)) {
|
|
43
44
|
// то переводимо в корінь
|
|
44
45
|
window.location.replace('/')
|
|
45
46
|
} else {
|