Преглед изворни кода

Merge pull request #188 from smiclea/fix-login-loop

Fix an infinite loop when having expired token
Dorin Paslaru пре 8 година
родитељ
комит
ead0059104
2 измењених фајлова са 1 додато и 2 уклоњено
  1. 0 1
      src/sources/UserSource.js
  2. 1 1
      src/utils/ApiCaller.js

+ 0 - 1
src/sources/UserSource.js

@@ -134,7 +134,6 @@ class UserSource {
         resolve(data)
       }).catch(() => {
         cookie.remove('token')
-        cookie.remove('projectId')
         Api.setDefaultHeader('X-Auth-Token', null)
         reject()
       })

+ 1 - 1
src/utils/ApiCaller.js

@@ -94,7 +94,7 @@ class ApiCaller {
           }
 
           if (error.response.status === 401 && window.location.hash !== loginUrl) {
-            window.location.href = `/${loginUrl}`
+            window.location.href = '/'
           }
 
           console.log(`%cError Response: ${axiosOptions.url}`, 'color: #D0021B', error.response)