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
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...