From 8036256568f6d47532e7b06ac09834fa276dc883 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Thu, 16 May 2019 16:53:04 +0100 Subject: [PATCH 1/2] Return expires_in with exchangeCodeForToken() and refreshAccessToken() --- src/v1/AuthAPIClient.ts | 6 ++++-- src/v1/interfaces/auth/ITokenResponse.ts | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/v1/AuthAPIClient.ts b/src/v1/AuthAPIClient.ts index 2df0ce0..a53329e 100644 --- a/src/v1/AuthAPIClient.ts +++ b/src/v1/AuthAPIClient.ts @@ -129,7 +129,8 @@ export class AuthAPIClient { const parsedResponse: IAuthResponse = JSON.parse(response); return { access_token: parsedResponse.access_token, - refresh_token: parsedResponse.refresh_token + refresh_token: parsedResponse.refresh_token, + expires_in: parsedResponse.expires_in }; } catch (error) { throw new ApiError(error); @@ -163,7 +164,8 @@ export class AuthAPIClient { const parsedResponse: IAuthResponse = JSON.parse(response); return { access_token: parsedResponse.access_token, - refresh_token: parsedResponse.refresh_token + refresh_token: parsedResponse.refresh_token, + expires_in: parsedResponse.expires_in }; } catch (error) { throw new ApiError(error); diff --git a/src/v1/interfaces/auth/ITokenResponse.ts b/src/v1/interfaces/auth/ITokenResponse.ts index 98e58e2..5876e7d 100644 --- a/src/v1/interfaces/auth/ITokenResponse.ts +++ b/src/v1/interfaces/auth/ITokenResponse.ts @@ -9,4 +9,6 @@ export interface ITokenResponse { access_token: string; /** A long lived code use to obtain a new access_token when expired. It will be returned only if the scope offline_access was requested */ refresh_token: string; + /** access_token validity in seconds */ + expires_in: number; } From 173dd00ad760d54cc98a5813f0e809a1f6b4b119 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Thu, 16 May 2019 16:53:59 +0100 Subject: [PATCH 2/2] Don't store package-lock.json --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b14d4f2..d3f4e76 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,5 @@ deploy/releases/*.yaml # .cache directories **/.cache + +package-lock.json