other things working well, but my delete isn't working :
deleteAccount: async (password: string) => { try { // First, delete all active sessions try { const sessions = await account.listSessions(); for (const session of sessions.sessions) { await account.deleteSession(session.$id); } } catch (error) { console.log('No sessions to delete'); }
// Verify credentials by creating a temporary session
const user = await account.get();
await account.createEmailPasswordSession(user.email, password);
// Now delete the account
await account.delete();
return true;
} catch (error) {
console.error('Delete account error:', error);
throw error;
}
},
whats the error?
(NOBRIDGE) ERROR Delete account error: [AppwriteException: User (role: guests) missing scope (account)]
@Darshan Pandya
i think when you delete all the sessions, the get call fails and might be the one throwing an error.
when i remove that i get Delete account error: [AppwriteException: Creation of a session is prohibited when a session is active.]
Recommended threads
- Auth working for emulator but not for ph...
hey guys i'm using appwrite for expo react native it is working perfectly for emulator but does not working for physical devices can u explain any one and it is...
- Database column name change makes table ...
Hi, new here! I'm currently building an app where there's a table called "track_sessions" whose column "creator" I wanted to change to "creatorID". However, af...
- SyntaxError: The requested module 'node-...
I am trying to use appwrite functions and in the function i am creating rows but i got this error when i executed the funtion. As i checked docs there TablesDB...