From b779f9e75dddd389e74ec05b4df34ca79b6f9fc6 Mon Sep 17 00:00:00 2001 From: Amar Zavery Date: Fri, 3 Nov 2017 17:45:19 -0700 Subject: [PATCH] acquireUserCode returns UserCodeInfo in the callback --- lib/adal.d.ts | 12 ++++++++++-- package-lock.json | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/adal.d.ts b/lib/adal.d.ts index 7952363..2592520 100644 --- a/lib/adal.d.ts +++ b/lib/adal.d.ts @@ -151,6 +151,14 @@ export interface ErrorResponse { */ export type AcquireTokenCallback = (error: Error, response: TokenResponse | ErrorResponse) => void; +/** + * This is the callback that is passed to all acquireUserCode method below. + * @callback AcquireTokenCallback + * @param {Error} [error] If the request fails this parameter will contain an Error object. + * @param {UserCodeInfo} [response] On a succesful request returns a {@link UserCodeInfo}. + */ +export type AcquireUserCodeCallback = (error: Error, response: UserCodeInfo) => void; + /** * This is an interface that can be implemented to provide custom token cache persistence. * @public @@ -325,9 +333,9 @@ export class AuthenticationContext { * @param {string} resource A URI that identifies the resource for which the device_code and user_code is valid for. * @param {string} clientId The OAuth client id of the calling application. * @param {string} language The language code specifying how the message should be localized to. - * @param {AcquireTokenCallback} callback The callback function. + * @param {AcquireUserCodeCallback} callback The callback function. */ - public acquireUserCode(resource: string, clientId: string, language: string, callback: AcquireTokenCallback): void; + public acquireUserCode(resource: string, clientId: string, language: string, callback: AcquireUserCodeCallback): void; /** * Gets a new access token using via a certificate credential. diff --git a/package-lock.json b/package-lock.json index f1b69ab..c511be1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "adal-node", - "version": "0.1.23", + "version": "0.1.24", "lockfileVersion": 1, "requires": true, "dependencies": {