Merge pull request #25871 from ascariandrea/react-native-auth0

rea t-native-auth0: Added missing optional refreshToken in PasswordRealmResponse
This commit is contained in:
Ron Buckton
2018-05-18 14:10:42 -07:00
committed by GitHub
2 changed files with 14 additions and 6 deletions
+1
View File
@@ -54,6 +54,7 @@ export interface PasswordRealmResponse {
idToken: string;
scope: string;
tokenType: "Bearer";
refreshToken?: string;
}
export interface RefreshTokenParams {
@@ -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",