@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/token.js +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/vite-boot",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "Vite boot",
5
5
  "type": "module",
6
6
  "exports": {
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
- if (window.location.pathname === '/login') {
41
+ // Якщо ми на сторінці логіну або логауту
42
+ const awayFrom = ['/login', '/logout']
43
+ if (awayFrom.includes(window.location.pathname)) {
43
44
  // то переводимо в корінь
44
45
  window.location.replace('/')
45
46
  } else {