Hey! You need to check if session.loading is true or not before. If it’s true, you can return null, else check for the doesSessionExist boolean
a
aV
09/25/2022, 2:54 PM
vs code says doesSessionExist does not exists
aV
09/25/2022, 2:54 PM
Copy code
const Home = () => {
let session = useSessionContext();
if (session.loading) {
// Session loading is generally very fast, so we do not recommend you to use a loading screen here.
return null;
}
if (session.doesSessionExist) {
return <Dashboard />;
} else {
return <Landing />;
}
};
export default Home;
r
rp_st
09/25/2022, 2:55 PM
Huh.. that’s weird. Maybe restart vacode? Does ts compile work though?
a
aV
09/25/2022, 2:56 PM
its strange. Though its complaining but working fine 😅
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).