How i change the behaviour of saving token in loca...
# help
b
How i change the behaviour of saving token in local storage?
c
Can you clarify how exactly you want to change the behavior?
b
I want to keep session in db. And then check if the session still valid on the server side
And not on client. Like in express-session with mongodb Basically i want to save the it in cookie for now.
c
Ok, I can only give you a few bits of relevant info, but I am not sure if that will give you the complete picture (maybe someone else with more knowledge in auth can help):
- you can disable storing of token in localstorage from the supabase client constructor (there is an optional third parameter, you can pass { persistSession: false} to it
- supabase.auth.api has 2 methods - getUserByCookie and setAuthCookie, I think they are meant to be used on the server side