diff --git a/packages/@webex/plugin-authorization-browser-first-party/src/authorization.js b/packages/@webex/plugin-authorization-browser-first-party/src/authorization.js index 9b09e8e4fa1..91be8a7ce34 100644 --- a/packages/@webex/plugin-authorization-browser-first-party/src/authorization.js +++ b/packages/@webex/plugin-authorization-browser-first-party/src/authorization.js @@ -302,7 +302,7 @@ const Authorization = WebexPlugin.extend({ * @param {String} verificationUrl * @returns {String} */ - _generateQRCodeVerificationUrl(verificationUrl = '') { + _generateQRCodeVerificationUrl(verificationUrl) { const baseUrl = 'https://web.webex.com/deviceAuth'; const urlParams = new URLSearchParams(new URL(verificationUrl).search); const userCode = urlParams.get('userCode'); diff --git a/packages/@webex/plugin-authorization-browser-first-party/test/unit/spec/authorization.js b/packages/@webex/plugin-authorization-browser-first-party/test/unit/spec/authorization.js index e75962f29ec..b08af627998 100644 --- a/packages/@webex/plugin-authorization-browser-first-party/test/unit/spec/authorization.js +++ b/packages/@webex/plugin-authorization-browser-first-party/test/unit/spec/authorization.js @@ -447,7 +447,7 @@ describe('plugin-authorization-browser-first-party', () => { it('should generate a QR code URL when a userCode is present', () => { const verificationUrl = 'https://example.com/verify?userCode=123456'; const oauthHelperUrl = 'https://oauth-helper-a.wbx2.com/helperservice/v1'; - const expectedUrl = 'https://web.webex.com/deviceAuth?usercode%3D123456%26oauthhelper%3Dhttps%3A%2F%2Foauth-helper-a.wbx2.com%2Fhelperservice%2Fv1'; + const expectedUrl = 'https://web.webex.com/deviceAuth?usercode=123456&oauthhelper=https%3A%2F%2Foauth-helper-a.wbx2.com%2Fhelperservice%2Fv1'; const webex = makeWebex('http://example.com'); @@ -473,20 +473,6 @@ describe('plugin-authorization-browser-first-party', () => { oauthHelperSpy.restore(); }); - - it('should return the original verificationUrl when it is an empty string', () => { - const verificationUrl = ''; - const webex = makeWebex('http://example.com'); - - const oauthHelperSpy = sinon.stub(webex.internal.services, 'get'); - const result = webex.authorization._generateQRCodeVerificationUrl(verificationUrl); - - assert.notCalled(oauthHelperSpy); - assert.equal(result, verificationUrl); - - oauthHelperSpy.restore(); - }); - }); describe('#initQRCodeLogin()', () => {