Use number instead of function
This commit is contained in:
@ -101,14 +101,15 @@ export const createApp = (): {
|
||||
if (!env.dev.isLocal) {
|
||||
const apiLimiter = rateLimit({
|
||||
windowMs: 60 * 1000, // 1 minute
|
||||
max: async (req) => {
|
||||
// 100 RPM for an authenticated request, 5 for a non-authenticated request
|
||||
// const token = await getClaimsByToken(
|
||||
// // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
// req.header('authorization') ?? req.cookies['auth']
|
||||
// )
|
||||
return 100 // token ? 100 : 10
|
||||
},
|
||||
max: 100,
|
||||
// async (req) => {
|
||||
// // 100 RPM for an authenticated request, 5 for a non-authenticated request
|
||||
// // const token = await getClaimsByToken(
|
||||
// // // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
// // req.header('authorization') ?? req.cookies['auth']
|
||||
// // )
|
||||
// return 100 // token ? 100 : 10
|
||||
// },
|
||||
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
|
||||
legacyHeaders: false, // Disable the `X-RateLimit-*` headers
|
||||
keyGenerator: (req) => {
|
||||
|
||||
Reference in New Issue
Block a user