best way to store data in a session supabase and toddle
In bubble you can easily add new columns to a user table and then easily access those columns through e .g . "current user 's profile picture " . In supabase you cannot add new columns to authentication and thus you need to add a new table with such columns as profile pic , first name , last name , etc . Now , I would need to have easy access to these values . What is the best way I can store these variables of the current user (profile pic , first name , last name , etc . ) in the session for easy access so that I do not have to make an api call everytime I need them ? So , the moment the user logs in the variables are stored and , ideally , they are updated automatically if the user changes them Thanks π1[this ] ( https://discord.com/channels/972416966683926538/1274310112143609866 ) was very helpful but I would probably need some more practical suggestions with my example above You can make the api call on the app -root or page level , set an event on success that updates a variable with the data and you can either [expose a formula in the context ] ( https://www.youtube.com/watch?v=KHCopeS0Fk4&t=350s ) so it 's easy accesible or work you way down in [abstraction ] ( https://www.youtube.com/watch?v=PQjMZ_0ju1g ) passing the data through attributes to components π1If you need admins /users to be able to edit another user 's data though , you need to create your own user 's table auth table data can only be accessed /updated by that user @Janis @Lucas G thanks for the input . I managed to implement this . how can I then access the profile _id below from the cookies : { "sub " : "072253c3 -31d8 -4299 -a6b6 -2263db4603c1 " , "aud " : "authenticated " , "exp " : 1736939458 , "iat " : 1736935858 , "email " : "test1 @gmail .com " , "phone " : " " , "app _metadata " : { "provider " : "email " , "providers " : [ "email " ] } , "user _metadata " : { "profile _id " : 6 , "profile _image " : "test1 " } , "role " : "authenticated " , "aal " : "aal1 " , "amr " : [ { "method " : "password " , "timestamp " : 1736935858 } ] , "session _id " : "6b975bcf -e75d -4d83 -8a5a -6269e8385f67 " , "is _anonymous " : false } I used jwt .io , pasted the access token , and this was shown under payload data Like if you don βt do the api call then there is no way of saying whether a user is authenticated ok , understood . that was a question down on the line on page redirect . thanks . by wrapper component you mean like a page ? so if i want a page accessible only to authenticated users I do : on page lifecycle - > on load - > get auth and redirect based on that result ? thanks Almost : I can share a screenshot later but the idea is : - you have the Supabase auth call set to auto fetch - you have a page with a component /element called e .g auth -wrapper - > here you add your app elements as children - the auth -wrapper has a conditional show based on the success of the Supabase auth call β 2