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
- TablesDB `updateRows` returns `database_...
Hi Appwrite team! I’m seeing a strange issue with TablesDB bulk row updates on a self-hosted Appwrite instance. **Environment** - Appwrite self-hosted `1.9.0` ...
- [SOLVED] Realtime Missing Channels
```js useEffect(() => { let subscription: RealtimeSubscription; async function loadChips() { try { const {rows: chi...
- Update row sheet not loading
After right clicking a row header and click update, the sidebar fails to load (never-ending skeleton)