1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

added option to disable auto totp copying

This commit is contained in:
Kyle Spearrin
2017-07-21 10:54:41 -04:00
parent 592b14149f
commit a6ee05ef93
7 changed files with 125 additions and 38 deletions

View File

@@ -3,6 +3,7 @@ function ConstantsService() {
disableGaKey: 'disableGa',
disableAddLoginNotificationKey: 'disableAddLoginNotification',
disableContextMenuItemKey: 'disableContextMenuItem',
disableAutoTotpCopyKey: 'disableAutoTotpCopy',
lockOptionKey: 'lockOption',
lastActiveKey: 'lastActive',
encType: {

View File

@@ -1,4 +1,5 @@
function TotpService() {
function TotpService(constantsService) {
this.constantsService = constantsService;
initTotpService();
}
@@ -105,4 +106,20 @@ function initTotpService() {
return otp;
});
};
TotpService.prototype.isAutoCopyEnabled = function () {
var deferred = Q.defer();
var self = this;
chrome.storage.local.get(self.constantsService.disableAutoTotpCopyKey, function (obj) {
if (obj && !!obj[self.constantsService.disableAutoTotpCopyKey]) {
deferred.resolve(false);
}
else {
deferred.resolve(true);
}
});
return deferred.promise;
};
}