November 2017
Beginner to intermediate
288 pages
7h 33m
English
Let's create our API and implement the Admin SDK delete functionality:
req.post('/users/:uid/delete', (req, res) => { admin.auth().deleteUser(req.params.uid) .then(() => { //[*] Response is empty if everything went OK ! }) .catch(err => { logger.error(`External Error: While deleting user account, with ${req.params.uid}, & with error : ${err}`); res.json({ message: `Error: while deleting your account, with error: ${err}`}); }); })
Typically, we're done; all you need is to do is properly handle the response from the backend, which should be blank, or if not, handle the shown error.
Read now
Unlock full access