From b3470fd64d8484ef6b0298ed4b8877631b768a78 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Tue, 7 Nov 2023 08:45:58 -0500 Subject: [PATCH] fix: Error handling on forgot password page (no-changelog) (#7633) fixes: https://linear.app/n8n/issue/ADO-1339/fix-error-handling-on-forgot-password-page --- packages/cli/src/controllers/passwordReset.controller.ts | 1 + packages/editor-ui/src/views/ForgotMyPasswordView.vue | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/controllers/passwordReset.controller.ts b/packages/cli/src/controllers/passwordReset.controller.ts index ef25cbd826..acca0ed4c2 100644 --- a/packages/cli/src/controllers/passwordReset.controller.ts +++ b/packages/cli/src/controllers/passwordReset.controller.ts @@ -35,6 +35,7 @@ import { rateLimit } from 'express-rate-limit'; const throttle = rateLimit({ windowMs: 5 * 60 * 1000, // 5 minutes limit: 5, // Limit each IP to 5 requests per `window` (here, per 5 minutes). + message: { message: 'Too many requests' }, }); @RestController() diff --git a/packages/editor-ui/src/views/ForgotMyPasswordView.vue b/packages/editor-ui/src/views/ForgotMyPasswordView.vue index eaae4a39f8..80fc2ad365 100644 --- a/packages/editor-ui/src/views/ForgotMyPasswordView.vue +++ b/packages/editor-ui/src/views/ForgotMyPasswordView.vue @@ -88,8 +88,8 @@ export default defineComponent({ }); } catch (error) { let message = this.$locale.baseText('forgotPassword.smtpErrorContactAdministrator'); - if (error.isAxiosError) { - const { status } = error.response; + if (error.httpStatusCode) { + const { httpStatusCode: status } = error; if (status === 429) { message = this.$locale.baseText('forgotPassword.tooManyRequests'); } else if (error.httpStatusCode === 422) {