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: {
|
access: {
|
||||||
unlock: mustBeAdminForCollections,
|
unlock: mustBeAdminForCollections,
|
||||||
update: mustBeAdminOrSelf,
|
update: mustBeAdminOrSelf,
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { cloudStorage } from "@payloadcms/plugin-cloud-storage";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { buildConfig } from "payload/config";
|
import { buildConfig } from "payload/config";
|
||||||
import { sftpAdapter } from "payloadcms-sftp-storage";
|
import { sftpAdapter } from "payloadcms-sftp-storage";
|
||||||
|
import { mustBeAdmin } from "./accesses/collections/mustBeAdmin";
|
||||||
import { Audios } from "./collections/Audios/Audios";
|
import { Audios } from "./collections/Audios/Audios";
|
||||||
import { ChronologyEvents } from "./collections/ChronologyEvents/ChronologyEvents";
|
import { ChronologyEvents } from "./collections/ChronologyEvents/ChronologyEvents";
|
||||||
import { Collectibles } from "./collections/Collectibles/Collectibles";
|
import { Collectibles } from "./collections/Collectibles/Collectibles";
|
||||||
|
@ -87,6 +88,11 @@ export default buildConfig({
|
||||||
graphQL: {
|
graphQL: {
|
||||||
disable: true,
|
disable: true,
|
||||||
},
|
},
|
||||||
|
rateLimit: {
|
||||||
|
window: 900_000, // 15 minutes
|
||||||
|
max: 500,
|
||||||
|
skip: (req) => !!mustBeAdmin({ req }),
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
cloudStorage({
|
cloudStorage({
|
||||||
collections: {
|
collections: {
|
||||||
|
|
Loading…
Reference in New Issue