From 4267839b96c8b629e39cd8df9ffef62c4c8cd4c0 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Sat, 3 Oct 2020 11:08:50 -0400 Subject: [PATCH] test: reduce branching in authenticator --- ui/core/app/authenticators/password.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/core/app/authenticators/password.js b/ui/core/app/authenticators/password.js index a0ceccdd9..43a9c8fb7 100644 --- a/ui/core/app/authenticators/password.js +++ b/ui/core/app/authenticators/password.js @@ -63,7 +63,7 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator { authenticate() { return super.authenticate(...arguments).then((data) => { const token = data?.token; - if (token) this.addTokenToAuthorization(token); + this.addTokenToAuthorization(token); return data; }); } @@ -93,6 +93,6 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator { const headers = adapterPrototype?.headers; if (!headers) adapterPrototype.headers = {}; adapterPrototype.headers.Authorization = null; - if (token) adapterPrototype.headers.Authorization = `Bearer ${token}`; + adapterPrototype.headers.Authorization = `Bearer ${token}`; } }