lynndylanhurley / devise_token_auth

Token based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth.
Do What The F*ck You Want To Public License
3.54k stars 1.13k forks source link

IP saved on db is from front-end, not user's IP #965

Open romdim opened 6 years ago

romdim commented 6 years ago

I haven't found anyone else reporting this. We use devise, devise-token-auth and ng-token-auth connecting Rails and Angular.

Our issue is that the current_sign_in_ip and last_sign_in_ip saved on db are the IP of front-end server and not the user's IP.

Is anyone else having this issue and know how to fix it? Is there a way to post to devise and save the correct IP?

lynndylanhurley commented 6 years ago

Are you using a proxy on your client app?

romdim commented 6 years ago

It's hosted on Google Cloud, in a container, so I guess it is proxied, yes..