#Does Payload hide IP's?

35 messages · Page 1 of 1 (latest)

vivid pilot
#

My frontend and cms is both proxied through cloudflare, on my nextjs frontend i can get the user ip via CF-Conntecting-Ip but on payload this is undefined? I am trying to get the Ip in the beforeOperation hook in the users collection

uncut galleonBOT
wet tendon
#

How are you trying to get the IP?

vivid pilot
wet tendon
#

Did you try ['x-forwarded-for'] already?

#

oh i see, thats CF header

vivid pilot
#

yea, thats undefined cause we proxy from cloudflare

wet tendon
#

Hmm. can you turn on trustProxy

#

I'm not positive, but I think that obfuscates proxied IPs

#

if its off

vivid pilot
#

kk

wet tendon
#

Let me know if that works

vivid pilot
#

oh ratelimit property

wet tendon
#

yeah

vivid pilot
wet tendon
#

Do any CF headers come back with a value?

vivid pilot
wet tendon
#

Similarly, people mention the need to allow the CF proxy

#

I wonder if you can access it via the middleware, its odd it would be undefined

vivid pilot
#

oh wait

#

i need it to be cf-connecting-ip

#

i did CF-Connecting-IP

wet tendon
#

Ahhhh

#

well

#

im not sure case sensitivity matters

#

but lets see

vivid pilot
#

yea it worked lol, can i dm you something?

wet tendon
#

oh wow!

#

Very nice

#

sure!

uncut galleonBOT
vivid pilot
#

Thanks for the help though, much appreciated :D