simplify payload and cookie removal

This commit is contained in:
jb-alvarado 2020-05-24 17:51:06 +02:00
parent dbe4001c62
commit c453616a64

View File

@ -59,8 +59,7 @@ export const actions = {
}, },
async refreshToken ({ commit, state }) { async refreshToken ({ commit, state }) {
const payload = { const payload = {
refresh: state.jwtRefresh, refresh: state.jwtRefresh
progress: false
} }
await this.$axios.post('auth/token/refresh/', payload) await this.$axios.post('auth/token/refresh/', payload)
@ -70,9 +69,7 @@ export const actions = {
}) })
.catch((error) => { .catch((error) => {
if (error.response.status === 401) { if (error.response.status === 401) {
this.$cookies.remove('token') commit('REMOVE_TOKEN')
this.$cookies.remove('refresh')
commit('UPADTE_TOKEN', { token: null, refresh: null })
commit('UPDATE_IS_LOGIN', false) commit('UPDATE_IS_LOGIN', false)
} }
}) })