Skip to content

Commit 2a0e272

Browse files
authored
fix: last sign in time (#945)
1 parent 55bef70 commit 2a0e272

File tree

1 file changed

+1
-1
lines changed
  • delete-unused-accounts-cron/functions

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function getInactiveUsers(users = [], nextPageToken) {
6969
const result = await admin.auth().listUsers(1000, nextPageToken);
7070
// Find users that have not signed in in the last 30 days.
7171
const inactiveUsers = result.users.filter(
72-
user => Date.parse(user.metadata.lastSignInTime) < (Date.now() - 30 * 24 * 60 * 60 * 1000));
72+
user => Date.parse(user.metadata.lastRefreshTime || user.metadata.lastSignInTime) < (Date.now() - 30 * 24 * 60 * 60 * 1000));
7373

7474
// Concat with list of previously found inactive users if there was more than 1000 users.
7575
users = users.concat(inactiveUsers);

0 commit comments

Comments
 (0)