https://supertokens.com/ logo
#general
Title
# general
s

Sun Walker

06/17/2020, 4:04 PM
Ah, cool this is my function to run on initial app load (removed /check)
Copy code
JavaScript
  const initialCheck = async () => {
    const val = await st.doesSessionExist();
    const id = await getUserId();
    if (val && id) {
      setAuthFlow({ loading: false, loggedIn: true, pop: true });
    } else {
      setAuthFlow({ loading: false, loggedIn: false, pop: true });
    }
  };