Last active
December 16, 2020 00:22
-
-
Save gkweb/b2176aa523cb79ee5b87aa25e0634d70 to your computer and use it in GitHub Desktop.
Bulk/Batch delete auth0 users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WARNING USE WITH CAUTION! This will delete any user in the search result!!! - You have been warned! | |
// Quicker than setting up the Management API with all its related tooling | |
// Step 1 - Search for the users you want to delete in /dashboard/COUNTRYCODE/TENANT/users | |
// Step 2 - Open the browser console and paste the following. Be sure to read the warning at the top of the file. | |
Array.prototype.slice.call(document.querySelectorAll('table[data-cosmos-key=table] > tbody > tr')).forEach(e => { | |
setTimeout(() => { | |
console.log('Deleting...') | |
e.querySelector('td:last-child button').click() | |
e.querySelector('td:last-child ul li:last-child').click() | |
document.querySelector('[data-cosmos-key="dialog.footer"] span:first-child button').click() | |
}, 1000) | |
}) | |
// Step 3 - You may need to repeat Step 2 again - If there are multiple pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment