I am working on an app with a cohort team and we are using createEmailPasswordSession ... all of this is being run in nextJs via a context provider.
useEffect(() => {
const getSession = async () => {
try {
await account.getSession('current');
console.log('User is signed in');
} catch (error) {
console.log(error);
}
};
getSession();
}, []);
this is great if a session exists. but if it doesn't it returns an error ... is there a better way to check if a session exists.
goal is on page loads to route user to a dashboard or not based on if they are logged in.
Recommended threads
- type generation on same columns in table
is there way to prevent this ? or only need to update column name like table prefix?
- Unable to send verification email
Hi! I’m trying to access my project on Appwrite Cloud (fra.cloud.appwrite.io), but I keep getting this popup saying: “To continue using Appwrite Cloud, please...
- Converting circularstructure to JSON
Hello 👋, when this will be fixed on Appwrite Sites? It's draining our quotas for Sentry, it must be a problem with the default logger which is always on for Ap...