Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to get connecting client's IP on the Supabase side #714

Open
2 tasks done
nukeop opened this issue Dec 29, 2023 · 0 comments
Open
2 tasks done

No way to get connecting client's IP on the Supabase side #714

nukeop opened this issue Dec 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@nukeop
Copy link

nukeop commented Dec 29, 2023

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

When I'm using @supabase/ssr, and establish a session in a client browser, then use a server action in my Next.js application, there is no way to pass the client's IP to Supabase.

For example, when I'm using a browser-side client, the IP is visible in the X-Real-IP header, because the client is connecting directly to the Supabase backend. I can confirm that in the Edge API log browser.

But when I want to run a server action, the connection is now client->Next.js server->Supabase. This extra step loses track of the IP and I see no way to pass it along. The IP displayed in the logs is actually the AWS IP that my Next.js application is running on.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a Next.js application and add @supabase/ssr.
  2. Setup the package according to the instructions in the docs.
  3. Write a simple server action, for example for fetching anything from the database.
  4. Perform the action.
  5. Go to the logs in Supabase, and inspect the GET request.

Expected behavior

I'd expect an extra X-something header that would contain the client's actual IP.

ScreenshotsN/A

System information

  • OS: All
  • Browser (if applies) All
  • Version of supabase-js: 2.39.1
  • Version of Node.js: 18
@nukeop nukeop added the bug Something isn't working label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant