From c7fbb9b0bf4bb7b4ba70276c10f7cbcc231e4c73 Mon Sep 17 00:00:00 2001 From: elweyn Date: Tue, 7 Dec 2021 10:19:29 +0100 Subject: [PATCH] Changed the Login error handling so that we get the no-account message in case of a specific error, else we send the user to /reset/login --- backend/src/graphql/resolver/UserResolver.ts | 1 - frontend/src/views/Pages/Login.vue | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 9856e1968..bebc32e1e 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -199,7 +199,6 @@ export class UserResolver { throw new Error('No user with this credentials') }) if (!loginUser.emailChecked) { - // TODO we want to catch this on the frontend and ask the user to check his emails or resend code throw new Error('User email not validated') } if (loginUser.password === BigInt(0)) { diff --git a/frontend/src/views/Pages/Login.vue b/frontend/src/views/Pages/Login.vue index 5f86b1600..0ce209551 100755 --- a/frontend/src/views/Pages/Login.vue +++ b/frontend/src/views/Pages/Login.vue @@ -105,7 +105,7 @@ export default { loader.hide() }) .catch((error) => { - if (!error.message.includes('User email not validated')) { + if (error.message.includes('No user with this credentials')) { this.$toasted.error(this.$t('error.no-account')) } else { // : this.$t('error.no-email-verify')