Help Needed: Appwrite Email Verification Error
'$collectionId': 'users'
Error in register function: AppwriteException: app.67188ef30017689a30d2@service.cloud.appwrite.io (role: applications) missing scope (account)
at e.call (/workspaces/pithy_platform/.next/server/chunks/2747.js:56:36863)
...
code: 401,
type: 'general_unauthorized_scope',
response: {
message: 'app.67188ef30017689a30d2@service.cloud.appwrite.io (role: applications) missing scope (account)',
code: 401,
type: 'general_unauthorized_scope',
version: '1.6.1'
}
The issue seems to relate to missing permissions or scope for the account role. Here’s the relevant portion of my register function:
// Step 1: Create the account
const newUserAccount = await account.create(userId, email, password, `${firstname} ${lastname}`);
console.log("New user account:", newUserAccount.emailVerification);
if (!newUserAccount) {
throw new Error("Account not created");
}
// Step 2: Create user info in the database
const userinfo = await databases.createDocument(db, userCollection, userId, {
...userdata,
user_id: userId,
categories: categories || [],
});
console.log("User information created:", userinfo);
// Step 3: Generate a session for the new user
const session = await account.createEmailPasswordSession(email, password);
console.log("Session created:", session);
// Step 4: Send a verification email
await account.createVerification("http://localhost:3000/verify");
// Set a secure cookie for the session
cookies().set("my-session", session.secret, {
path: "/",
httpOnly: true,
sameSite: "strict",
secure: true,
});
It looks like the app.<app-id>@service.cloud.appwrite.io role doesn't have the required account scope, but I’m unsure how to fix this.
Has anyone encountered this before or have insights into resolving this issue?
Recommended threads
- Enabling Overage Usage
Hello Appwrite Support Team, I am currently using Appwrite under the GitHub Student Developer Pack plan. Recently, my project hit the database read limit, and ...
- appwrite-docs MCP fails in Cursor — SSE ...
Hi team, I'm having trouble getting the hosted Appwrite docs MCP working in Cursor on Windows. Environment IDE: Cursor (latest) OS: Windows 11 Node: v24.15.0 ...
- Migration from Cloud to Self-Hosted not ...
Hello Appwrite Community, I've got the problem, that when I try to migrate my Appwrite Project from the cloud to my self-hosted Appwrite, that an API Key is mi...