mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 21:37:32 -08:00
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:
parent
2f665683fc
commit
b3470fd64d
|
@ -35,6 +35,7 @@ import { rateLimit } from 'express-rate-limit';
|
||||||
const throttle = rateLimit({
|
const throttle = rateLimit({
|
||||||
windowMs: 5 * 60 * 1000, // 5 minutes
|
windowMs: 5 * 60 * 1000, // 5 minutes
|
||||||
limit: 5, // Limit each IP to 5 requests per `window` (here, per 5 minutes).
|
limit: 5, // Limit each IP to 5 requests per `window` (here, per 5 minutes).
|
||||||
|
message: { message: 'Too many requests' },
|
||||||
});
|
});
|
||||||
|
|
||||||
@RestController()
|
@RestController()
|
||||||
|
|
|
@ -88,8 +88,8 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
let message = this.$locale.baseText('forgotPassword.smtpErrorContactAdministrator');
|
let message = this.$locale.baseText('forgotPassword.smtpErrorContactAdministrator');
|
||||||
if (error.isAxiosError) {
|
if (error.httpStatusCode) {
|
||||||
const { status } = error.response;
|
const { httpStatusCode: status } = error;
|
||||||
if (status === 429) {
|
if (status === 429) {
|
||||||
message = this.$locale.baseText('forgotPassword.tooManyRequests');
|
message = this.$locale.baseText('forgotPassword.tooManyRequests');
|
||||||
} else if (error.httpStatusCode === 422) {
|
} else if (error.httpStatusCode === 422) {
|
||||||
|
|
Loading…
Reference in a new issue