Skip to content

Commit

Permalink
fix: user profile not loaded and silent refresh attribution.
Browse files Browse the repository at this point in the history
- Fix the user profile not loaded as described in issue #62.
- Silent refresh bool set was not right, dealing undefined #76.
  • Loading branch information
mauriciovigolo committed Jun 26, 2018
1 parent b8aaec1 commit 3e48ac4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class KeycloakService {
this._bearerExcludedUrls = options.bearerExcludedUrls || [];
this._authorizationHeaderName = options.authorizationHeaderName || 'Authorization';
this._bearerPrefix = this.sanitizeBearerPrefix(options.bearerPrefix);
this._silentRefresh = options.initOptions.flow === 'implicit';
this._silentRefresh = options.initOptions ? options.initOptions.flow === 'implicit' : false;
this._instance = Keycloak(options.config);
this.bindsKeycloakEvents();
this._instance
Expand Down Expand Up @@ -430,7 +430,13 @@ export class KeycloakService {
loadUserProfile(forceReload: boolean = false): Promise<Keycloak.KeycloakProfile> {
return new Promise(async (resolve, reject) => {
if (this._userProfile && !forceReload) {
return resolve(this._userProfile);
resolve(this._userProfile);
return;
}

if (!(await this.isLoggedIn())) {
reject('The user profile was not loaded as the user is not logged in.');
return;
}

this._instance
Expand Down

0 comments on commit 3e48ac4

Please sign in to comment.