how do you configure what data associated with the...
# help
j
how do you configure what data associated with the user from the db is returned i the user_metadata object when a session is returned after loggin in?
l
That object is just the content of users.raw_user_meta_data column in auth schema
j
well i don't want to shove duplicate data in there. is there a way to pull other data in?
l
By updating that table with SQL client on the server-site is a possible way of doing it, but I would not recommend it and rather go with a custom table (like profiles) in the regular public schema.
That column is intended as a place where auth providers dump the payload from the response
j
right i have a table called projects with a id. i would like to returned the ids of the projects associated with the user in the metadata object
l
I would recommend making an extra request which returns that relation. I expect that you have some table like public.project_members or something like that
j
it's going to be such a frequent request made through out the app i was hoping to not have to make the same request on every trip
l
Or create a custom Postgres function which will return users projects with RPC call
j
hmm
l
Can you cache that result? I am for example using a react-query as a wrapper that holds the data in the cache
j
server side?
l
No, on the client site. I don't think that the repetitive calling will be that big of a deal as you might think 🙂
j
just trying to get ride of repetitive waste