Userbase

SDK : SignInWithSession

SignInWithSession lets you automatically log in a user using the last used session. This API will return a promise that gets resolved once the session has been validated. If the session is valid, the user gets automatically logged in.

    userbase.signInWithSession()
  .then((session) => {
    if (session.user) {
      // there is a valid active session
      console.log(session.user.username)
    }
  })
  .catch((e) => console.error(e))
  

Result

Errors