Am using next js
export async function createAdminClient() {
const client = new Client()
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT || "")
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT || "")
.setKey(process.env.NEXT_APPWRITE_KEY || "");
return {
get account() {
return new Account(client);
},
};
}
export async function logout(currentState: { message: string }) {
try {
const { account } = await createAdminClient();
await account.deleteSession("current");
cookies().delete("my-custom-session");
console.log("Logged out successfully");
redirect("/login");
} catch (error) {
console.log(error);
return {
message: "Invalid email or password",
};
}
}
error
{ code: 401, type: 'general_unauthorized_scope', response: { message: 'app.66fe880a001f23a26817@service.cloud.appwrite.io (role: applications) missing scope (account)', code: 401, type: 'general_unauthorized_scope', version: '1.6.0' } }
Recommended threads
- [AppwriteException: Network request fail...
endpoint https://cloud.appwrite.io/v1 is giving me this error across all of my expo projects right now. Every project was working perfectly fine until last ni...
- Appwrite Cloud is a trojan, says Malwar...
Since today, my Malwarebytes doesn't let me connect to appwrite cloud anymore. I try to connect from my own (WIP) website and the connections seem to all be fin...
- How to do order by on REST?
I want to do order `queries[]={"method": "orderAsc", "values": ["$id"]}` This parameter is correct? Cause nothing happened