
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
- 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...
- Attributes Problem - Cloud
I am not able to see the attribute columns and their context on cloud. Can you help?
