Skip to content
Snippets Groups Projects
Commit 061667f4 authored by Guilherme Gazzo's avatar Guilherme Gazzo
Browse files

regression: properly overwrite `OAuth._retrievePendingCredential`

parent d983b7b3
No related merge requests found
...@@ -71,11 +71,11 @@ const recreateError = (errorDoc: Error | Meteor.Error): Error | Meteor.Error => ...@@ -71,11 +71,11 @@ const recreateError = (errorDoc: Error | Meteor.Error): Error | Meteor.Error =>
return copyTo(errorDoc, error); return copyTo(errorDoc, error);
}; };
OAuth._retrievePendingCredential = function (key, ...args): string | Error | void { OAuth._retrievePendingCredential = async function (key, ...args): Promise<string | Error | void> {
const credentialSecret = args.length > 0 && args[0] !== undefined ? args[0] : undefined; const credentialSecret = args.length > 0 && args[0] !== undefined ? args[0] : undefined;
check(key, String); check(key, String);
const pendingCredential = OAuth._pendingCredentials.findOne({ const pendingCredential = await OAuth._pendingCredentials.findOneAsync({
key, key,
credentialSecret, credentialSecret,
}); });
......
...@@ -13,7 +13,7 @@ declare module 'meteor/oauth' { ...@@ -13,7 +13,7 @@ declare module 'meteor/oauth' {
} }
namespace OAuth { namespace OAuth {
function _retrievePendingCredential(key: string, ...args: string[]): void; function _retrievePendingCredential(key: string, ...args: string[]): Promise<string | Error | void>;
function openSecret(secret: string): string; function openSecret(secret: string): string;
function retrieveCredential(credentialToken: string, credentialSecret: string); function retrieveCredential(credentialToken: string, credentialSecret: string);
function _retrieveCredentialSecret(credentialToken: string): string | null; function _retrieveCredentialSecret(credentialToken: string): string | null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment