Give more specific reason for failed login
This commit is contained in:
parent
c0e8111d64
commit
ccc460bb5e
3 changed files with 9 additions and 5 deletions
|
@ -96,7 +96,11 @@ const users = {
|
|||
} else {
|
||||
// Authentication failed
|
||||
commit('endLogin')
|
||||
reject()
|
||||
if (response.status === 401) {
|
||||
reject('Wrong username or password')
|
||||
} else {
|
||||
reject('An error occured, please try again')
|
||||
}
|
||||
}
|
||||
commit('endLogin')
|
||||
resolve()
|
||||
|
@ -104,7 +108,7 @@ const users = {
|
|||
.catch((error) => {
|
||||
console.log(error)
|
||||
commit('endLogin')
|
||||
reject()
|
||||
reject('Failed to connect to server, try again')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue