From 88fc427e7afe8798ff04f3151873b4740e4376fe Mon Sep 17 00:00:00 2001 From: Randil Fernando Date: Mon, 25 Dec 2017 18:01:36 +0530 Subject: [PATCH] fixed set auth issue --- package.json | 2 +- src/modules/auth/providers/auth.provider.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 811573f..17639e2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "simple-angular-jwt-auth", "description": "authentication package for angular 5 using HttpClientModule", "author": "randil.fernando@outlook.com", - "version": "0.0.2", + "version": "0.0.4", "license": "MIT", "scripts": { "ng": "ng", diff --git a/src/modules/auth/providers/auth.provider.ts b/src/modules/auth/providers/auth.provider.ts index 7a84b63..9f1312e 100644 --- a/src/modules/auth/providers/auth.provider.ts +++ b/src/modules/auth/providers/auth.provider.ts @@ -44,7 +44,7 @@ export class AuthProvider { [auth.accessToken, auth.refreshToken] = await Promise.all([accessTokenPromise, refreshTokenPromise]); } - return await this.setAuth(auth); + return await this.setAuth(auth, false); } public async logOut(): Promise { @@ -52,7 +52,7 @@ export class AuthProvider { } public async setAuth(auth: Auth, persist: boolean = true): Promise { - if (auth.accessToken === null || this.accessToken === '') { + if (!auth.accessToken || auth.accessToken === '') { return false; }