Skip to content

Commit

Permalink
fix(auth): fix auth service isAuthenticated, onAuthenticationChange n…
Browse files Browse the repository at this point in the history
…ot returning a boolean, fix #15

Closes #15
  • Loading branch information
nnixaa committed Oct 26, 2017
1 parent bcbfcc0 commit 93d45f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/framework/auth/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class NbAuthService {
* @returns {Observable<any>}
*/
isAuthenticated(): Observable<any> {
return this.getToken().map(token => token && token.getValue());
return this.getToken().map(token => !!(token && token.getValue()));
}

/**
Expand All @@ -113,7 +113,7 @@ export class NbAuthService {
* @returns {Observable<any>}
*/
onAuthenticationChange(): Observable<boolean> {
return this.onTokenChange().map(token => !!token);
return this.onTokenChange().map(token => !!(token && token.getValue()));
}

/**
Expand Down

0 comments on commit 93d45f1

Please sign in to comment.