fix(webui): clearer error message on login error

This commit is contained in:
Gauthier Roebroeck 2021-07-26 09:42:01 +08:00
parent e49047b4c9
commit ca054f642f

View File

@ -29,8 +29,10 @@ export default class KomgaUsersService {
msg = 'Invalid authentication'
}
}
if (e.response.data.message) {
if (e.response?.data?.message) {
msg += `: ${e.response.data.message}`
} else {
msg += `: ${e.message}`
}
throw new Error(msg)
}