
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
- Oauth2-Error 400Invalid `success` param:...
My code: > await new Account(client).createOAuth2Session(OAuthProvider.Google, 'https://www.mydomain.online/home', 'https://www.mydomain.online'); I ha...
- I don't know why i am getting this plan ...
I am getting this plan upgradation message while accessing the App write service to authorise and logiin and signUp new iuser fom my react website. in the porta...
- Issue with `listDocuments` when using qu...
Hello, Appwrite team! I'm having an issue with `listDocuments` when using query modifiers: **Environment:** - Self-hosted Appwrite (`Version 1.4.13`) installe...
