Hello, I am making a anonymous session in next js server side by doing :
export async function createAnon() {
const client = new Client()
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT as string)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT as string);
const account = new Account(client);
const result = await account.createAnonymousSession();
return result;
}
then I try to convert the anonymous account to a normal one by doing update mail :
export async function createAccountFromAnon(email: string, password: string) {
const client = new Client()
.setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT as string)
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT as string)
.setSession('current');
const account = new Account(client);
const result = await account.updateEmail(
email,
password
);
return result;
}
and I get the following error :
Error: User (role: guests) missing scope (account) lib/server/appwrite.ts (42:20) @ async createAccountFromAnon
40 | const account = new Account(client); 41 |
42 | const result = await account.updateEmail( | ^ 43 | email, 44 | password 45 | );
I am probably missing something here
Recommended threads
- [Self-hosted] Realtime crashes with "Mis...
- Regarding Rate Limits
Hello, I am a student engineer who built an internal website for my university club using AppWrite. My club currently has around 500 members, and when I recent...
- Problem adding domain onto the project a...
I have used 2 domains on the project HavanaDev (havanadev.pro and havanadev.com). .com was just redirected to . Pro domain. .pro is expired, now I’d like to use...