From 2f363c3e3a3543d1fae001cd1ca69e48669121b9 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 2 Sep 2016 01:21:01 -0400 Subject: [PATCH] === warnings --- .../wwwroot/app/directives/passwordMeterDirective.js | 11 ++++++----- .../wwwroot/app/directives/passwordViewerDirective.js | 4 ++-- src/Web/wwwroot/app/services/authService.js | 2 +- src/Web/wwwroot/app/services/cryptoService.js | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Web/wwwroot/app/directives/passwordMeterDirective.js b/src/Web/wwwroot/app/directives/passwordMeterDirective.js index 2d26adbbf7..d712ebe530 100644 --- a/src/Web/wwwroot/app/directives/passwordMeterDirective.js +++ b/src/Web/wwwroot/app/directives/passwordMeterDirective.js @@ -3,7 +3,9 @@ angular .directive('passwordMeter', function () { return { - template: '
{{value}}%
', + template: '
{{value}}%
', restrict: 'A', scope: { password: '=passwordMeter', @@ -12,15 +14,15 @@ angular }, link: function (scope) { var measureStrength = function (username, password) { - if (!password || password == username) { + if (!password || password === username) { return 0; } var strength = password.length; if (username && username !== '') { - if (username.indexOf(password) != -1) strength -= 15; - if (password.indexOf(username) != -1) strength -= username.length; + if (username.indexOf(password) !== -1) strength -= 15; + if (password.indexOf(username) !== -1) strength -= username.length; } if (password.length > 0 && password.length <= 4) strength += password.length; @@ -47,7 +49,6 @@ angular case 0: case 1: return 'danger'; - case 2: return 'warning'; case 3: diff --git a/src/Web/wwwroot/app/directives/passwordViewerDirective.js b/src/Web/wwwroot/app/directives/passwordViewerDirective.js index 5772b08d9a..67f3626733 100644 --- a/src/Web/wwwroot/app/directives/passwordViewerDirective.js +++ b/src/Web/wwwroot/app/directives/passwordViewerDirective.js @@ -13,11 +13,11 @@ angular element.onclick = function (event) { }; element.on('click', function (event) { var passwordElement = $(passwordViewer); - if (passwordElement && passwordElement.attr('type') == 'password') { + if (passwordElement && passwordElement.attr('type') === 'password') { element.removeClass('fa-eye').addClass('fa-eye-slash'); passwordElement.attr('type', 'text'); } - else if (passwordElement && passwordElement.attr('type') == 'text') { + else if (passwordElement && passwordElement.attr('type') === 'text') { element.removeClass('fa-eye-slash').addClass('fa-eye'); passwordElement.attr('type', 'password'); } diff --git a/src/Web/wwwroot/app/services/authService.js b/src/Web/wwwroot/app/services/authService.js index d34391f381..ac00c7d29e 100644 --- a/src/Web/wwwroot/app/services/authService.js +++ b/src/Web/wwwroot/app/services/authService.js @@ -75,7 +75,7 @@ angular } var decodedToken = jwtHelper.decodeToken(token); - var twoFactor = decodedToken.authmethod == "TwoFactor"; + var twoFactor = decodedToken.authmethod === "TwoFactor"; _userProfile = { id: decodedToken.nameid, diff --git a/src/Web/wwwroot/app/services/cryptoService.js b/src/Web/wwwroot/app/services/cryptoService.js index c658ff8bb2..364acfed65 100644 --- a/src/Web/wwwroot/app/services/cryptoService.js +++ b/src/Web/wwwroot/app/services/cryptoService.js @@ -99,7 +99,7 @@ angular } var encPieces = encValue.split('|'); - if (encPieces.length != 2) { + if (encPieces.length !== 2) { return ''; }