Skip to content

Commit

Permalink
fix: Error handling on forgot password page (no-changelog) (n8n-io#7633)
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoE105 authored Nov 7, 2023
1 parent 2f66568 commit b3470fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/cli/src/controllers/passwordReset.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-ui/src/views/ForgotMyPasswordView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b3470fd

Please sign in to comment.