From 14aea5fdebd9549d0aa1e4cb44fb9287c471b379 Mon Sep 17 00:00:00 2001 From: Mike Appleby Date: Thu, 4 May 2017 14:36:51 -0500 Subject: [PATCH] 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. --- delete-unused-accounts-cron/functions/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/delete-unused-accounts-cron/functions/index.js b/delete-unused-accounts-cron/functions/index.js index b611eea..d8c156d 100644 --- a/delete-unused-accounts-cron/functions/index.js +++ b/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);