In this function, is there a way to check that there's an account connected before calling account.get(), or maybe mute the console.error from Appwrite in prod ? Because I get a 401 error in my console when not connected.
export async function getUser() { try {
return await account.get();
} catch (error) {
console.log("Get user failed : user probably not logged in");
return null;
}
}
I try adding this but I get a new scope error:
const session = await account.getSession('current'); if (!session) { console.log("No active session found"); return null; } I tried some jwt token shenanigan but still i get an error
I need this to get to 100 in my best practice lighthouse test
Recommended threads
- Appwrite Cloud project is paused and nev...
Hi Appwrite Team & Community, I am facing a problem with one of my Appwrite Cloud projects which seems to be identical to the other cases of "paused projects" ...
- Timed out waiting for runtime error
execution id 6a3e0791978712d81ee0 im having issue with appwrite function runtime performance. even after 4gbram and cpu same function sometimes completes in a...
- Project auto-blocked after load testing ...
Hi team 👋 My project has been automatically blocked with the message: "Project is currently blocked — Access to this project is restricted. Contact support if...