
I am getting this error even after the user is logged In
https://cloud.appwrite.io/v1/account 401 (Unauthorized)
try {
const userData = await account.get();
setUser(userData);
console.log("USERDATAAAAAAAAAAA", userData);
if (userData) {
router.replace("/");
window.location.reload();
}
setLoading(false);
} catch (error) {
console.log(error);
setLoading(false);
}
};
The above function was to check and fetch userData (User Is already signed In till here)
Below is my appwriteConfgi code
const client = new sdk.Client()
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject("ProjectId")
.setKey(
"apiKey"
);
export const account = new sdk.Account(client);
export const users = new sdk.Users(client);
export const storage = new sdk.Storage(client);
export const databases = new sdk.Databases(client);
(Have removed APi key and projectId as of now for posting)

const result = await account.createEmailPasswordSession(
email, // email
password // password
);
return result;
};```
This is what i am using to log in the user
Recommended threads
- phantom relationships appear on parent c...
i have this bug were my past deleted collection apears as relationship to my parent collection. when i try to delete that relationship from parent it gives me e...
- Attribute stuck on proccessing
i tried creating a new attribute butits stuck on proccessing,i did a hard refresh,cleared cache everything but still stuck on proccessing,also in my functions w...
- Appwrite Cloud Custom Domains Issue
I’m trying to configure my custom domain appwrite.qnarweb.com (CNAME pointing to fra.cloud.appwrite.io with Cloudflare proxy disabled) but encountering a TLS ce...
