From 5f798583db4561723c52edafd4eccebff79dff00 Mon Sep 17 00:00:00 2001 From: Alexander Matyushentsev Date: Tue, 2 Jul 2019 14:36:07 -0700 Subject: [PATCH] Fix JS UI crash if user is not authenticated (#1863) --- ui/src/app/shared/services/auth-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/app/shared/services/auth-service.ts b/ui/src/app/shared/services/auth-service.ts index a5fa8c1077..e8b6801907 100644 --- a/ui/src/app/shared/services/auth-service.ts +++ b/ui/src/app/shared/services/auth-service.ts @@ -13,6 +13,6 @@ export class AuthService { const cookies = parse(document.cookie); const token = cookies['argocd.token']; const user: any = token && jwt(token) || null; - return (user && user.email || user.sub) || ''; + return (user && (user.email || user.sub)) || ''; } }