From 93d45f17f9b29131eb168ed854855e537d868af5 Mon Sep 17 00:00:00 2001 From: Dmitry Nehaychik <4dmitr@gmail.com> Date: Thu, 26 Oct 2017 16:36:37 +0300 Subject: [PATCH] fix(auth): fix auth service isAuthenticated, onAuthenticationChange not returning a boolean, fix #15 Closes #15 --- src/framework/auth/services/auth.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/framework/auth/services/auth.service.ts b/src/framework/auth/services/auth.service.ts index c6f6527205..c5f33a2016 100644 --- a/src/framework/auth/services/auth.service.ts +++ b/src/framework/auth/services/auth.service.ts @@ -96,7 +96,7 @@ export class NbAuthService { * @returns {Observable} */ isAuthenticated(): Observable { - return this.getToken().map(token => token && token.getValue()); + return this.getToken().map(token => !!(token && token.getValue())); } /** @@ -113,7 +113,7 @@ export class NbAuthService { * @returns {Observable} */ onAuthenticationChange(): Observable { - return this.onTokenChange().map(token => !!token); + return this.onTokenChange().map(token => !!(token && token.getValue())); } /**