How i change the behaviour of saving token in local storage?
c
chipilov
11/15/2021, 7:18 AM
Can you clarify how exactly you want to change the behavior?
b
BBB
11/15/2021, 9:10 AM
I want to keep session in db. And then check if the session still valid on the server side
BBB
11/15/2021, 9:11 AM
And not on client.
Like in express-session with mongodb
Basically i want to save the it in cookie for now.
c
chipilov
11/15/2021, 9:20 AM
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):
chipilov
11/15/2021, 9:21 AM
- 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
chipilov
11/15/2021, 9:22 AM
- supabase.auth.api has 2 methods - getUserByCookie and setAuthCookie, I think they are meant to be used on the server side