© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
6 replies
edo

Am I doing it all wrong?

I am building something that needs a server since it handles exchange of access and refresh tokens with Google and Microsoft. I decided to use Supabase for handling user signup / login to have one less thing to think about. But now I am faced with the following problems that makes me question whether I am using Supabase correctly and whether it fits my needs.

The scenario I am facing is the following:
A client logs in and then requests some information from the server. 
The server retrieves the `access_token` for the user and gets the information
The server sends the information back to the client
A client logs in and then requests some information from the server. 
The server retrieves the `access_token` for the user and gets the information
The server sends the information back to the client


A few questions:
1. How does the client makes an authenticated request to the server?
From this thread, my understanding is that I need to send a JWT to the server, and then the server needs to create a new Client (via
supabase-js
supabase-js
for example) and that will tell me which user is making the request.

2. Once I know the user that is making the request, I want to retrieve her tokens from the database. From my googling, it doesn't look like I can modify the table where the user information is stored
auth.users
auth.users
, so what is the best way to go about this? Should I create a new table that contains the
id
id
of the user and the relative tokens? Do I do this from the web console of Supabase?
GitHub
Is it possible to make requests "as" a particular user on the serve...
For context, I'm using Next.js with supabase-js, roughly following the Next.js with supabase auth example. I have a policy uid() = user_id on a table with row level security turned on, and ...
Is it possible to make requests "as" a particular user on the serve...
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Row RLS: What am I doing wrong here?
SupabaseSSupabase / help-and-questions
7mo ago
I am able to fetch the profile, not able to update it. What am I doing wrong here?
SupabaseSSupabase / help-and-questions
8mo ago
I am doing a pg vector search, and when I have too many documents, it returns no results. Ideas?
SupabaseSSupabase / help-and-questions
3y ago
I removed data from table by wrong and i am in free plan
SupabaseSSupabase / help-and-questions
7mo ago