fix: reject OAuth linking across different GitHub identities

This commit is contained in:
tdurieux
2026-09-06 09:16:53 +02:00
parent 50d606d0c1
commit a401bb21d6
2 changed files with 15 additions and 0 deletions
+4
View File
@@ -69,6 +69,10 @@ const verify = async (
// the isAdmin flag.
user = await UserModel.findOne({ username: profile.username });
if (user) {
if (user.externalIDs?.github && user.externalIDs.github !== profile.id) {
done(new AnonymousError("not_connected", { httpStatus: 401 }));
return;
}
if (isDisabledAccount(user.status)) {
done(
new AnonymousError(