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",