mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-12 21:58:57 +02:00
fix: reject OAuth linking across different GitHub identities
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user