1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

add Invalid token handler

This commit is contained in:
Rokt33r
2015-10-21 09:25:42 +09:00
parent f6d2e898dc
commit c507dfa6c4

View File

@@ -41,13 +41,19 @@ ReactDOM.render((
loadingCover.parentNode.removeChild(loadingCover) loadingCover.parentNode.removeChild(loadingCover)
// Refresh user information // Refresh user information
fetchCurrentUser() if (auth.user() != null) {
.then(function (res) { fetchCurrentUser()
let user = res.body .then(function (res) {
store.dispatch(updateUser(user)) let user = res.body
}) store.dispatch(updateUser(user))
.catch(function (err) { })
console.error(err.message) .catch(function (err) {
console.log('Fetch failed') if (err.status === 401) {
}) auth.clear()
if (window != null) window.location.reload()
}
console.error(err.message)
console.log('Fetch failed')
})
}
}) })