Fix login error messages

This commit is contained in:
Christian Cueni 2020-04-30 14:17:56 +02:00
parent e147ca65e0
commit fd619ab47b
2 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,6 @@ export default {
if (response.data) { if (response.data) {
redirectRouteName = 'registration'; redirectRouteName = 'registration';
} }
this.$apollo.mutate({ this.$apollo.mutate({
mutation: HELLO_EMAIL_MUTATION, mutation: HELLO_EMAIL_MUTATION,
variables: { variables: {

View File

@ -59,7 +59,6 @@ export default {
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error)
if (error.response.data.message && error.response.data.message === 'Sie haben sich nicht korrekt eingeloggt oder Ihr Konto ist vor\u00fcbergehend deaktiviert.') { if (error.response.data.message && error.response.data.message === 'Sie haben sich nicht korrekt eingeloggt oder Ihr Konto ist vor\u00fcbergehend deaktiviert.') {
this.passwordErrors = ['Sie haben sich nicht korrekt eingeloggt oder Ihr Konto ist vorübergehend deaktiviert.']; this.passwordErrors = ['Sie haben sich nicht korrekt eingeloggt oder Ihr Konto ist vorübergehend deaktiviert.'];
} else { } else {
@ -97,8 +96,7 @@ export default {
} }
} }
} catch (e) { } catch (e) {
console.warn(e); that.passwordErrors = ['Es ist ein Fehler aufgetreten. Bitte versuchen Sie nochmals.'];
that.loginError = 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie nochmals.';
} }
} }
}) })
@ -106,7 +104,10 @@ export default {
const firstError = errors.graphQLErrors[0]; const firstError = errors.graphQLErrors[0];
switch (firstError.message) { switch (firstError.message) {
case 'invalid_credentials': case 'invalid_credentials':
that.loginError = 'Die E-Mail oder das Passwort ist falsch. Bitte versuchen Sie nochmals.'; that.passwordErrors = ['Die E-Mail oder das Passwort ist falsch. Bitte versuchen Sie nochmals.'];
break;
case 'email_not_verified':
that.passwordErrors = ['Bitte verifiziere zuerst deine E-Mail.'];
break; break;
case 'no_valid_license': case 'no_valid_license':
this.$router.push({name: 'licenseActivation'}) this.$router.push({name: 'licenseActivation'})