Open sirpy opened 5 years ago
To be honest, I'm not sure if I want to support this .delete()
as a method. It was added by someone else. Or if I do, I might refactor/rename/change its behavior, just as a heads up. But this is super low on priority list.
Hey @amark so fast forward 2023 how do you delete users? it say nothing in the online docs, just delete data in general
This also seem to not work anymore: https://stackoverflow.com/a/37758715/15578244
var users = gun.get('users');
users.put({alice: {name: 'alice'}, bob: {name: 'bob'}});
users.path('bob').put(null);
Uncaught TypeError: users.path is not a function
EDIT: nvm, I found it: https://gun.eco/docs/User#user-delete
user.delete("bob", "my secret", ()=>{ console.log("deleted"); });
@blazer2k1 does user.delete("bob", "my secret", ()=>{ console.log("deleted"); });
work for you? on my end, I get OK -response in the ack, but the user is not actually deleted it seems.
@gustavcorpas, somehow that works for me, maybe @amark really needs to have some clarity on this matter.
Sometimes it works but most times SEA starts throwing errors and localstorage has some strange gun data.
No SEA errors from above delete, but localstorage has this:
the field has 803KB of data in locastorage
reloading the page trying to create a new user with different credentials results in this SEA error
only clearing localstorage allows to create new user. but in any case the old username cannot be recreated/loggedin, sea says user is already logging in or being created