diff --git a/.changeset/three-parrots-lie.md b/.changeset/three-parrots-lie.md new file mode 100644 index 00000000000..609fa5183e7 --- /dev/null +++ b/.changeset/three-parrots-lie.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue where rocket.chat would not properly log OAuth errors nor remove the credential with the error from the internal list diff --git a/apps/meteor/app/2fa/server/loginHandler.ts b/apps/meteor/app/2fa/server/loginHandler.ts index b554330e140..1d039c7a89e 100644 --- a/apps/meteor/app/2fa/server/loginHandler.ts +++ b/apps/meteor/app/2fa/server/loginHandler.ts @@ -85,7 +85,7 @@ OAuth._retrievePendingCredential = async function (key, ...args): Promise = Omit< + Mongo.Collection, + 'remove' | 'findOne' | 'insert' | 'update' | 'upsert' + >; + interface IOauthCredentials extends IRocketChatRecord { key: string; credentialSecret: string; @@ -17,7 +23,8 @@ declare module 'meteor/oauth' { function openSecret(secret: string): string; function retrieveCredential(credentialToken: string, credentialSecret: string); function _retrieveCredentialSecret(credentialToken: string): string | null; - const _pendingCredentials: Mongo.Collection; + // luckily we don't have any reference to this collection on the client code, so let's type it according to what can be used on the server + const _pendingCredentials: MeteorServerMongoCollection; const _storageTokenPrefix: string; function launchLogin(options: {