Fix Server Errors Appear As Blank Red Bar (#9747)

* fix path to error message

* changed error message path to check user auth error
This commit is contained in:
Lula Villalobos 2018-01-12 14:33:01 -08:00 committed by Sabe Jones
parent b6305826be
commit db0a6f6bb8

View file

@ -207,7 +207,7 @@ export default {
if (error.response.status >= 400) {
// Check for conditions to reset the user auth
const invalidUserMessage = [this.$t('invalidCredentials'), 'Missing authentication headers.'];
if (invalidUserMessage.indexOf(error.response.data.message) !== -1) {
if (invalidUserMessage.indexOf(error.response.data) !== -1) {
this.$store.dispatch('auth:logout');
}
@ -222,7 +222,7 @@ export default {
this.$store.dispatch('snackbars:add', {
title: 'Habitica',
text: error.response.data.message,
text: error.response.data,
type: 'error',
timeout: true,
});