
I am building a logout script. It generates this error:
throw new AppwriteException(data === null || data === void 0 ? void 0 : data.message, response.status, data === null || data === void 0 ? void 0 : data.type, data); ^ AppwriteException: User (role: guests) missing scope (account)
I have confirmed that I am logged in and there is a session in the Appwrite - Auth - User - sessions table I have indicated where the error message is generated. This approach is from the documentation. I am implementing Client SDK. Can someone tell me what I am doing wrong. Thanks.
exports.logout = async (req,res) => {
const { Client, Account } = require("appwrite");
const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject(process.env.PROJECT_ID);
const account = new Account(client);
const currentSession = await account.getSession('current'); // <--- error message is generated here
console.log(currentSession)
const logout = async () => {
const acc= await account.deleteSession("current");
setLoggedInUser(null);
};
console.log(logout)
res.render('logout');
}
Recommended threads
- Getting issue while migrating from Self ...
i try to migrating my project but when do this error come and dont allow to crate that migration
- Pending upload some file, but not for ot...
When upload this file, always got pending. But when I upload another file, it works. Why?
- Need help setting up this error is showi...
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cl...
