diff --git a/common/messages.js b/common/messages.js index ea7eb009..9f9d7cfb 100644 --- a/common/messages.js +++ b/common/messages.js @@ -137,6 +137,7 @@ export const error = { SERVER_NO_CIDS_TO_CHECK: "No CIDs were entered, please check your input", //Users Create + SIGN_UP_RATE_LIMITED: "Too many sign up attempts. Please try again in 10 minutes", SERVER_EXISTING_USER_ALREADY: "That username is taken. Please try another one", EXISTING_USER_ALREADY: "That username is taken. Please try another one", INVALID_USERNAME: "Invalid username. Please include only letters and numbers", @@ -185,6 +186,7 @@ export const error = { "We're havign trouble fetching your information right now. Please try again", //Sign-in + SIGN_IN_RATE_LIMITED: "Too many sign in attempts. Please try again in 10 minutes", SIGN_IN: "Your username/password can't be blank", SERVER_SIGN_IN: "Your username/password can't be blank", SIGN_IN_USER_NOT_FOUND: "We're having trouble logging you in right now, please try again later", diff --git a/components/core/ApplicationHeader.js b/components/core/ApplicationHeader.js index 1a312cb6..9fe1a960 100644 --- a/components/core/ApplicationHeader.js +++ b/components/core/ApplicationHeader.js @@ -240,11 +240,11 @@ export default class ApplicationHeader extends React.Component { {} : this.props.onForward} > diff --git a/server.js b/server.js index a574b378..66de2969 100644 --- a/server.js +++ b/server.js @@ -28,13 +28,21 @@ const app = next({ const createLimiter = limit({ windowMs: 10 * 60 * 1000, // 10 minutes max: 5, - message: { decorator: "RATE_LIMITED", error: true, message: "You have made too many requests." }, + message: { + decorator: "SIGN_UP_RATE_LIMITED", + error: true, + message: "You have made too many requests.", + }, }); const loginLimiter = limit({ windowMs: 10 * 60 * 1000, // 10 minutes max: 5, - message: { decorator: "RATE_LIMITED", error: true, message: "You have made too many requests." }, + message: { + decorator: "SIGN_IN_RATE_LIMITED", + error: true, + message: "You have made too many requests.", + }, }); const handler = app.getRequestHandler();