Added missing optional refreshToken in PasswordRealmResponse, closes #25823.

This commit is contained in:
Andrea Ascari
2018-05-18 16:02:42 +02:00
parent 0e3cd2e17c
commit 26255b4c7d
2 changed files with 14 additions and 6 deletions

View File

@@ -54,6 +54,7 @@ export interface PasswordRealmResponse {
idToken: string;
scope: string;
tokenType: "Bearer";
refreshToken?: string;
}
export interface RefreshTokenParams {

View File

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