lint fixes

This commit is contained in:
Kyle Spearrin 2017-07-14 15:09:41 -04:00
parent 3a8f149008
commit cf850838b5
3 changed files with 11 additions and 10 deletions

View File

@ -55,7 +55,7 @@
} }
else if ($scope.providerType === constants.twoFactorProvider.email || else if ($scope.providerType === constants.twoFactorProvider.email ||
$scope.providerType === constants.twoFactorProvider.authenticator) { $scope.providerType === constants.twoFactorProvider.authenticator) {
token = token.replace(' ', '') token = token.replace(' ', '');
} }
$scope.loginPromise = authService.logIn(email, masterPassword, $scope.providerType, token, $scope.remember.checked); $scope.loginPromise = authService.logIn(email, masterPassword, $scope.providerType, token, $scope.remember.checked);
@ -122,7 +122,7 @@
providerPriority = provider[0].priority; providerPriority = provider[0].priority;
} }
} }
return providerType == null ? null : parseInt(providerType); return providerType === null ? null : parseInt(providerType);
} }
function init() { function init() {
@ -131,8 +131,9 @@
$timeout(function () { $timeout(function () {
$('#code').focus(); $('#code').focus();
var params;
if ($scope.providerType === constants.twoFactorProvider.duo) { if ($scope.providerType === constants.twoFactorProvider.duo) {
var params = providers[constants.twoFactorProvider.duo]; params = providers[constants.twoFactorProvider.duo];
$window.Duo.init({ $window.Duo.init({
host: params.Host, host: params.Host,
@ -144,7 +145,7 @@
}); });
} }
else if ($scope.providerType === constants.twoFactorProvider.u2f) { else if ($scope.providerType === constants.twoFactorProvider.u2f) {
var params = providers[constants.twoFactorProvider.u2f]; params = providers[constants.twoFactorProvider.u2f];
var challenges = JSON.parse(params.Challenges); var challenges = JSON.parse(params.Challenges);
u2f.init({ u2f.init({
@ -157,7 +158,7 @@
}); });
} }
else if ($scope.providerType === constants.twoFactorProvider.email) { else if ($scope.providerType === constants.twoFactorProvider.email) {
var params = providers[constants.twoFactorProvider.email]; params = providers[constants.twoFactorProvider.email];
$scope.twoFactorEmail = params.Email; $scope.twoFactorEmail = params.Email;
if (chrome.extension.getViews({ type: 'popup' }).length > 0) { if (chrome.extension.getViews({ type: 'popup' }).length > 0) {

View File

@ -172,7 +172,7 @@ angular
} }
}); });
}); });
}; }
function totpTick() { function totpTick() {
$timeout(function () { $timeout(function () {
@ -183,9 +183,9 @@ angular
$scope.totpSec = sec; $scope.totpSec = sec;
$scope.totpDash = (2.62 * mod).toFixed(2); $scope.totpDash = (2.62 * mod).toFixed(2);
$scope.totpLow = sec <= 7; $scope.totpLow = sec <= 7;
if (mod == 0) { if (mod === 0) {
totpUpdateCode(); totpUpdateCode();
} }
}); });
}; }
}); });

View File

@ -26,7 +26,7 @@ function initTotpService() {
bytes[i / 2] = parseInt(s.substr(i, 2), 16); bytes[i / 2] = parseInt(s.substr(i, 2), 16);
} }
return bytes; return bytes;
} };
var buff2hex = function (buff) { var buff2hex = function (buff) {
var bytes = new Uint8Array(buff); var bytes = new Uint8Array(buff);
@ -36,7 +36,7 @@ function initTotpService() {
hex.push((bytes[i] & 0xF).toString(16)); hex.push((bytes[i] & 0xF).toString(16));
} }
return hex.join(''); return hex.join('');
} };
var b32tohex = function (s) { var b32tohex = function (s) {
s = s.toUpperCase(); s = s.toUpperCase();