Browse Source

Change the uid property to localId in delete-unused-accounts-cron

The user id property is called localId, not uid. The uid property is
undefined.
master
Mike Appleby 8 years ago
parent
commit
14aea5fdeb
  1. 6
      delete-unused-accounts-cron/functions/index.js

6
delete-unused-accounts-cron/functions/index.js

@ -54,10 +54,10 @@ exports.accountcleanup = functions.https.onRequest((req, res) => {
const userToDelete = inactiveUsers.pop();
// Delete the inactive user.
return admin.auth().deleteUser(userToDelete.uid).then(() => {
console.log('Deleted user account', userToDelete.uid, 'because of inactivity');
return admin.auth().deleteUser(userToDelete.localId).then(() => {
console.log('Deleted user account', userToDelete.localId, 'because of inactivity');
}).catch(error => {
console.error('Deletion of inactive user account', userToDelete.uid, 'failed:', error);
console.error('Deletion of inactive user account', userToDelete.localId, 'failed:', error);
});
}
}, MAX_CONCURRENT);

Loading…
Cancel
Save