I'm currently writing some supabase auth code in a...
# supabase-kt
c
I'm currently writing some supabase auth code in a plain ol kotlin main app. I have auth via OTP done, but I basically need to re-OTP each time I run my app. Is there any way to tell supabase to store a session in a directory or something so that when I re-run main it reads from that directory and therefore identifies me as logged in already?
Interesting. it looks like supabase will do this already. But in my sample app... I'm basically making a chat between two users. and it looks as though the session is stored in the same spot so even though I have two supabase clients, they behave like 1 client. I'm assuming because they re-restore the same session even though they were initially two different user logins/sessions
i guess if i can modify the directory where they get saved by just being able to say
/user1
and
/user2
then that would be fine, but i can't seem to find any docs around that
j
Yea, by default the sessions get stored under the same key. The only case where this is different when using two different Supabase urls/projects. In any case you can update the default session manager:
Copy code
install(Auth) {
   sessionManager = SettingsSessionManager(key = yourCustomKey)
}
The key can be any string.
c
HECK YES. THANK YOU! IT WORKS!