When I used Firebase, all i had to do to stay logg...
# javascript
l
When I used Firebase, all i had to do to stay logged in was
onAuthStateChanged
. Supabase also provides the same function but when I refresh the page, it doesnt log `authenticated`(for example).
Copy code
ts
  const onStartup = async () => {
    try {
      console.log(client.auth.session())

      client.auth.onAuthStateChange((event, session) => {
        if (event == "SIGNED_IN") {
          return console.log("SIGNED_IN", session)
        }
        console.log("nione", session)
      })
    } catch (error) {
      console.log(error)
    }
  }
How can I keep user logged in, even if i refresh the page?
.
Pls tag when respond