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
- Database Write Limits hit
Hello Appwrite Admins, I'm a GitHub Education user, and about a week ago, my database was really badly optimized, resulting in about 600k writes in a single day...
- Help: Domain krtrim.tech Blocked on Fast...
Hi, I'm trying to add my domain krtrim.tech (and subdomain) in Appwrite, but I'm getting this error: Failed to add domain to Fastly: {"msg":"Bad request","deta...
- [CLOSED] Any known issues curerntly? dat...
Hi, Any known issues curerntly? database tab is not loading for me