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
This commit is contained in:
Ricardo Espinoza 2023-11-07 08:45:58 -05:00 committed by GitHub
parent 2f665683fc
commit b3470fd64d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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()

View file

@ -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) {