Fix JS UI crash if user is not authenticated (#1863)

This commit is contained in:
Alexander Matyushentsev 2019-07-02 14:36:07 -07:00 committed by GitHub
parent 9f8693a6a1
commit 5f798583db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)) || '';
}
}