mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-30 02:12:38 +03:00
added rate limit message and fixed application header arrows
This commit is contained in:
parent
ed9c40c861
commit
c8d6607e53
@ -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",
|
||||
|
@ -240,11 +240,11 @@ export default class ApplicationHeader extends React.Component {
|
||||
</span>
|
||||
<span
|
||||
css={STYLES_ICON_ELEMENT}
|
||||
style={{
|
||||
cursor: isForwardDisabled ? "not-allowed" : "default",
|
||||
color: isForwardDisabled ? Constants.system.border : "auto",
|
||||
marginLeft: 8,
|
||||
}}
|
||||
style={
|
||||
isForwardDisabled
|
||||
? { cursor: "not-allowed", color: Constants.system.border, marginLeft: 8 }
|
||||
: { marginLeft: 8 }
|
||||
}
|
||||
onClick={isForwardDisabled ? () => {} : this.props.onForward}
|
||||
>
|
||||
<SVG.NavigationArrow height="24px" />
|
||||
|
12
server.js
12
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();
|
||||
|
Loading…
Reference in New Issue
Block a user