Merge pull request #153 from MakerLab-Dev/patch-3

Improved error handling
This commit is contained in:
Mohit Panjwani
2020-02-09 12:00:23 +05:30
committed by GitHub
3 changed files with 20 additions and 17 deletions

View File

@ -21,13 +21,6 @@ export const login = ({ commit, dispatch, state }, data) => {
window.toastr['success']('Login Successful')
resolve(response)
}).catch(err => {
if (err.response.data.error === 'invalid_credentials') {
window.toastr['error']('Invalid Credentials')
} else {
// Something happened in setting up the request that triggered an Error
console.log('Error', err.message)
}
commit(types.AUTH_ERROR, err.response)
Ls.remove('auth.token')
reject(err)