mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-19 13:29:08 -06:00
fix: constants timeframe in seconds (#2434)
This commit is contained in:
committed by
GitHub
parent
1b5d3c216f
commit
8ef74fdaff
@@ -10,7 +10,7 @@ type Options = {
|
||||
const inMemoryRateLimiter = (options: Options) => {
|
||||
const tokenCache = new LRUCache<string, number>({
|
||||
max: 1000,
|
||||
ttl: options.interval,
|
||||
ttl: options.interval * 1000, // converts to expected input of milliseconds
|
||||
});
|
||||
|
||||
return async (token: string) => {
|
||||
|
||||
@@ -150,24 +150,24 @@ export const SURVEY_BG_COLORS = [
|
||||
|
||||
// Rate Limiting
|
||||
export const SIGNUP_RATE_LIMIT = {
|
||||
interval: 60 * 60 * 1000, // 60 minutes
|
||||
interval: 60 * 60, // 60 minutes
|
||||
allowedPerInterval: 30,
|
||||
};
|
||||
export const LOGIN_RATE_LIMIT = {
|
||||
interval: 15 * 60 * 1000, // 15 minutes
|
||||
interval: 15 * 60, // 15 minutes
|
||||
allowedPerInterval: 30,
|
||||
};
|
||||
export const CLIENT_SIDE_API_RATE_LIMIT = {
|
||||
interval: 5 * 60 * 1000, // 5 minutes
|
||||
interval: 5 * 60, // 5 minutes
|
||||
allowedPerInterval: 200,
|
||||
};
|
||||
export const SHARE_RATE_LIMIT = {
|
||||
interval: 60 * 60 * 1000, // 60 minutes
|
||||
interval: 60 * 60, // 60 minutes
|
||||
allowedPerInterval: 30,
|
||||
};
|
||||
|
||||
export const SYNC_USER_IDENTIFICATION_RATE_LIMIT = {
|
||||
interval: 60 * 1000, // 1 minute
|
||||
interval: 60, // 1 minute
|
||||
allowedPerInterval: 5,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user