From 6c7088bc01e4e95ef5dde9ab4eed305a2b7c2083 Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Mon, 18 Sep 2017 19:38:05 +0200 Subject: [PATCH] simplyfy currentUser checkup --- static/src/app/services/login-service/login-service.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/static/src/app/services/login-service/login-service.ts b/static/src/app/services/login-service/login-service.ts index 6b1d83b..f04f1f9 100644 --- a/static/src/app/services/login-service/login-service.ts +++ b/static/src/app/services/login-service/login-service.ts @@ -35,7 +35,6 @@ export class LoginService { signUp(username: string, password: string, secret: string) { return this.http.post(this.config.apiSignupPath, {username: username, password: password, secret: secret}) .map((response: Response) => { - }); } @@ -45,10 +44,7 @@ export class LoginService { } isLoggedIn() { - if (localStorage.getItem('currentUser')) { - return true; - } - return false + return !!localStorage.getItem('currentUser'); } hasPermission(level: number) {