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;
}
},