From 7554a2ae6192de00d14e85cb0867df66304f517e Mon Sep 17 00:00:00 2001 From: holy-batman <72770024+holy-batman@users.noreply.github.com> Date: Fri, 28 May 2021 16:03:54 -0300 Subject: [PATCH] fix uri when using jwt (#40) --- src/lwpUserAgent.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lwpUserAgent.js b/src/lwpUserAgent.js index 1fb7ca1..76cb349 100644 --- a/src/lwpUserAgent.js +++ b/src/lwpUserAgent.js @@ -57,14 +57,14 @@ export default class extends lwpRenderer { if (this._config.authentication.jwt) { config.authorization_jwt = this._config.authentication.jwt; - } else { - if (this._config.authentication.username) { - config.authorization_user = this._config.authentication.username; - config.uri = this._config.authentication.username + "@" + this._config.authentication.realm; - - if (this._config.authentication.password) { - config.password = this._config.authentication.password; - } + } + + if (this._config.authentication.username) { + config.authorization_user = this._config.authentication.username; + config.uri = this._config.authentication.username + "@" + this._config.authentication.realm; + + if (this._config.authentication.password) { + config.password = this._config.authentication.password; } }