From 26255b4c7dd19d2df3540c646be8b3c92bb60564 Mon Sep 17 00:00:00 2001 From: Andrea Ascari Date: Fri, 18 May 2018 16:02:42 +0200 Subject: [PATCH] Added missing optional refreshToken in PasswordRealmResponse, closes #25823. --- types/react-native-auth0/index.d.ts | 1 + .../react-native-auth0-tests.ts | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/types/react-native-auth0/index.d.ts b/types/react-native-auth0/index.d.ts index 153bfd65d9..1291baeafd 100644 --- a/types/react-native-auth0/index.d.ts +++ b/types/react-native-auth0/index.d.ts @@ -54,6 +54,7 @@ export interface PasswordRealmResponse { idToken: string; scope: string; tokenType: "Bearer"; + refreshToken?: string; } export interface RefreshTokenParams { diff --git a/types/react-native-auth0/react-native-auth0-tests.ts b/types/react-native-auth0/react-native-auth0-tests.ts index 3f659cbdee..08f8b0bc59 100644 --- a/types/react-native-auth0/react-native-auth0-tests.ts +++ b/types/react-native-auth0/react-native-auth0-tests.ts @@ -30,12 +30,19 @@ auth0.auth.logoutUrl({ returnTo: "http://localhost:3000" }); -auth0.auth.passwordRealm({ - username: "me@example.com", - password: "password", - realm: "realm", - audience: "user-info" -}); +auth0.auth + .passwordRealm({ + username: "me@example.com", + password: "password", + realm: "realm", + audience: "user-info" + }) + .then(res => { + if (res.refreshToken) { + return res.refreshToken; + } + return res.accessToken; + }); auth0.auth.refreshToken({ refreshToken: "refresh-token",