Hello, I want to make a verification to make sure an user haven't created any entry in collection by custom endpoint.
Other solutions than
request._peername
?
Is IP the best way to prevent entry duplication?
You have access to the {user} object in a custom endpoint, is that not sufficient?
Or is it like a public endpoint?
I want it because I want to avoid request spamming
it's a public endpoint
There is rate limiting implemented by default by IP
500 requests / 15min per IP
You can adjust those settings on the payload main config
Let me know if that doesn't solve your issue
No, I really want the IP in the request😁
Are you running behind a proxy?
in production on cloudflare
one solution is the cloudflare header, not tested tet
yet*
So if its your own proxy, you can usually use
'x-forwarded-for'
but im not sure the accuracy of that if its through cloudflare
You would need to adjust your nginx config if its not your own proxy as well
proxy_set_header X-Forwarded-For $remote_addr;
Star
Discord
online
Get dedicated engineering support directly from the Payload team.