Fix error messages during login for non-verified users (#1945)

This commit is contained in:
Siddharth Ramesh
2021-03-20 17:44:58 +05:30
committed by GitHub
parent 3043ee5058
commit 763d8d37df

View File

@@ -149,7 +149,13 @@ export default {
}
if (response && response.status === 401) {
this.showAlert(this.$t('LOGIN.API.UNAUTH'));
const { errors } = response.data;
const hasAuthErrorMsg = errors && errors.length && errors[0] && typeof errors[0] === 'string';
if (hasAuthErrorMsg) {
this.showAlert(errors[0]);
} else {
this.showAlert(this.$t('LOGIN.API.UNAUTH'));
}
return;
}
this.showAlert(this.$t('LOGIN.API.ERROR_MESSAGE'));