1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

copy totp to clipboard when autofilling

This commit is contained in:
Kyle Spearrin
2017-07-21 10:18:23 -04:00
parent 371488378a
commit 592b14149f
3 changed files with 45 additions and 37 deletions

View File

@@ -2,7 +2,7 @@ angular
.module('bit.current')
.controller('currentController', function ($scope, loginService, utilsService, toastr, $q, $window, $state, $timeout,
autofillService, $analytics, i18nService) {
autofillService, $analytics, i18nService, totpService, tokenService) {
$scope.i18n = i18nService;
var pageDetails = [],
@@ -83,9 +83,13 @@ angular
chrome.tabs.sendMessage(tabId, {
command: 'fillForm',
fillScript: fillScript
}, {
frameId: pageDetails[i].frameId
}, $window.close);
}, { frameId: pageDetails[i].frameId }, $window.close);
if (login.totp && tokenService.getPremium()) {
totpService.getCode(login.totp).then(function (code) {
utilsService.copyToClipboard(code);
});
}
}
}
}