Skip to content

Commit 22c442f

Browse files
committed
fix: prevent linking logins to cursus_user ids on anonymization
1 parent e4b6a7a commit 22c442f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/intra/cleanup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ const anonymizeUsers = async function(api: Fast42): Promise<void> {
7272
console.warn(`User ${user.login} has no cursus_users, cannot anonymize!`);
7373
continue;
7474
}
75-
console.log(`Anonymizing user ${user.login} using cursus_user ${cursusUser.id}...`);
75+
console.log(`Anonymizing user ${user.id} using cursus_user ${cursusUser.id}...`);
7676
// Fetch user using cursus_user to circumvent the fact that the Intra API does not return anonymized users
7777
// when using a regular student API key, even when requesting the user object with the specific user ID.
7878
// The user data is still intact in the cursus_user object, so we can copy Intra's anonymized name from there.
7979
const anonymizedData = await fetchSingle42ApiPage(api, `/cursus_users/${cursusUser.id}`, {});
8080
if (!anonymizedData.user) {
81-
console.warn(`User ${user.login} has no user data in their cursus_user ${cursusUser.id}, cannot anonymize!`);
81+
console.warn(`User ${user.id} has no user data in their cursus_user ${cursusUser.id}, cannot anonymize!`);
8282
continue;
8383
}
8484
await syncUser(anonymizedData.user);
8585
}
8686
catch (err) {
87-
console.error(`Error anonymizing user ${user.login}: ${err}`);
87+
console.error(`Error anonymizing user ${user.id}: ${err}`);
8888
}
8989
}
9090
};

0 commit comments

Comments
 (0)