Skip rate limiting on admin users
This commit is contained in:
parent
03baffdc3c
commit
f796de1438
|
@ -65,7 +65,11 @@ export const Recorders = buildCollectionConfig({
|
|||
],
|
||||
},
|
||||
},
|
||||
auth: { tokenExpiration: 24 * 60 * 60 },
|
||||
auth: {
|
||||
tokenExpiration: 24 * 60 * 60, // 1 day
|
||||
maxLoginAttempts: 5,
|
||||
lockTime: 900_000, // 15 minutes
|
||||
},
|
||||
access: {
|
||||
unlock: mustBeAdminForCollections,
|
||||
update: mustBeAdminOrSelf,
|
||||
|
|
|
@ -4,6 +4,7 @@ import { cloudStorage } from "@payloadcms/plugin-cloud-storage";
|
|||
import path from "path";
|
||||
import { buildConfig } from "payload/config";
|
||||
import { sftpAdapter } from "payloadcms-sftp-storage";
|
||||
import { mustBeAdmin } from "./accesses/collections/mustBeAdmin";
|
||||
import { Audios } from "./collections/Audios/Audios";
|
||||
import { ChronologyEvents } from "./collections/ChronologyEvents/ChronologyEvents";
|
||||
import { Collectibles } from "./collections/Collectibles/Collectibles";
|
||||
|
@ -87,6 +88,11 @@ export default buildConfig({
|
|||
graphQL: {
|
||||
disable: true,
|
||||
},
|
||||
rateLimit: {
|
||||
window: 900_000, // 15 minutes
|
||||
max: 500,
|
||||
skip: (req) => !!mustBeAdmin({ req }),
|
||||
},
|
||||
plugins: [
|
||||
cloudStorage({
|
||||
collections: {
|
||||
|
|
Loading…
Reference in New Issue