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
- My projects were deleted
Hello everyone, My projects were for some reason deleted. I got an email informing me about project inactivity, when I clicked to activate it again, it was sil...
- Dotnet functions on cloud
I'm trying to deploy my .Net8 functions to my project on cloud.appwrite through the CLI. I'm getting this error.
- All projects deleted
Hello, from the appwrite console last week I re-activated some of my old project and published them, yesterday I checked and none of the apps were working, now ...