diff --git a/types/oauth/index.d.ts b/types/oauth/index.d.ts index 21b74369e9..9f747e8b84 100644 --- a/types/oauth/index.d.ts +++ b/types/oauth/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for oauth 0.9 // Project: https://github.com/ciaranj/node-oauth#readme // Definitions by: nonAlgebraic +// Eduardo AC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -25,8 +26,8 @@ export type oauth2tokenCallback = ( export type dataCallback = ( err: {statusCode: number, data?: any}, - result: string | Buffer, - response: IncomingMessage + result?: string | Buffer, + response?: IncomingMessage ) => any; export class OAuth { @@ -285,7 +286,7 @@ export class OAuth2 { get(url: string, access_token: string, - callback: string + callback: dataCallback ): void; protected _getAccessTokenUrl(): string; diff --git a/types/passport-oauth2/index.d.ts b/types/passport-oauth2/index.d.ts index 7d7f3de21d..d985852bd6 100644 --- a/types/passport-oauth2/index.d.ts +++ b/types/passport-oauth2/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jaredhanson/passport-oauth2#readme // Definitions by: Pasi Eronen // Wang Zishi +// Eduardo AC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/passport-oauth2/passport-oauth2-tests.ts b/types/passport-oauth2/passport-oauth2-tests.ts index 6a5d09ef27..864b2cb9d6 100644 --- a/types/passport-oauth2/passport-oauth2-tests.ts +++ b/types/passport-oauth2/passport-oauth2-tests.ts @@ -51,6 +51,8 @@ const err3 = new InternalOAuthError('Hello', {}); class MyStrategy extends OAuth2Strategy { useProtectedProperty() { - this._oauth2.get('http://www.example.com/profile', 'token', 'http://www.example.com/callback'); + this._oauth2.get('http://www.example.com/profile', 'token', err => err.statusCode); + this._oauth2.get('http://www.example.com/profile', 'token', (err, result) => result); + this._oauth2.get('http://www.example.com/profile', 'token', (err, result, response) => response); } }