From 40c37143e0b2e46f7bb5454983b0070fb99401a0 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Thu, 11 Nov 2021 13:35:35 +1000 Subject: [PATCH] Fix linting in connectors (#1293) --- src/connectors/duo.ts | 2 +- src/connectors/sso.ts | 4 ++-- src/connectors/webauthn.ts | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/connectors/duo.ts b/src/connectors/duo.ts index f31011987b..a921bead10 100644 --- a/src/connectors/duo.ts +++ b/src/connectors/duo.ts @@ -13,7 +13,7 @@ document.addEventListener('DOMContentLoaded', event => { const hostParam = getQsParam('host'); const requestParam = getQsParam('request'); - var hostUrl = new URL('https://' + hostParam); + const hostUrl = new URL('https://' + hostParam); if (!hostUrl.hostname.endsWith('.duosecurity.com') && !hostUrl.hostname.endsWith('.duofederal.com')) { return; } diff --git a/src/connectors/sso.ts b/src/connectors/sso.ts index f4735ffe33..9cb2e76ba0 100644 --- a/src/connectors/sso.ts +++ b/src/connectors/sso.ts @@ -25,9 +25,9 @@ function initiateBrowserSso(code: string, state: string) { window.postMessage({ command: 'authResult', code: code, state: state }, '*'); const handOffMessage = ('; ' + document.cookie).split('; ssoHandOffMessage=').pop().split(';').shift(); document.cookie = 'ssoHandOffMessage=;SameSite=strict;max-age=0'; - let content = document.getElementById('content'); + const content = document.getElementById('content'); content.innerHTML = ''; - let p = document.createElement('p'); + const p = document.createElement('p'); p.innerText = handOffMessage; content.appendChild(p); } diff --git a/src/connectors/webauthn.ts b/src/connectors/webauthn.ts index 31d0c706d6..783724448d 100644 --- a/src/connectors/webauthn.ts +++ b/src/connectors/webauthn.ts @@ -4,6 +4,8 @@ import { buildDataString, parseWebauthnJson } from './common-webauthn'; // tslint:disable-next-line require('./webauthn.scss'); +const mobileCallbackUri = 'bitwarden://webauthn-callback'; + let parsed = false; let webauthnJson: any; let headerText: string = null; @@ -12,7 +14,6 @@ let btnReturnText: string = null; let parentUrl: string = null; let parentOrigin: string = null; let mobileResponse = false; -let mobileCallbackUri = 'bitwarden://webauthn-callback'; let stopWebAuthn = false; let sentSuccess = false; let obj: any = null; @@ -82,7 +83,7 @@ function parseParametersV2() { btnText: string; btnReturnText: string; callbackUri?: string; - mobile?: boolean + mobile?: boolean } = null; try { dataObj = JSON.parse(b64Decode(getQsParam('data')));