mirror of
https://github.com/bitwarden/web
synced 2025-12-10 21:33:16 +00:00
Added analytics telemetry throughout the application. Make sure angulartics bundles before the ga dependency.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
angular
|
||||
.module('bit.settings')
|
||||
|
||||
.controller('settingsTwoFactorController', function ($scope, apiService, $uibModalInstance, cryptoService, authService, $q, toastr) {
|
||||
.controller('settingsTwoFactorController', function ($scope, apiService, $uibModalInstance, cryptoService, authService, $q, toastr, $analytics) {
|
||||
$analytics.eventTrack('settingsTwoFactorController', { category: 'Modal' });
|
||||
var _issuer = 'bitwarden',
|
||||
_profile = authService.getUserProfile(),
|
||||
_masterPasswordHash;
|
||||
@@ -39,15 +40,17 @@
|
||||
var request = {
|
||||
enabled: !currentlyEnabled,
|
||||
token: model ? model.token : null,
|
||||
masterPasswordHash: _masterPasswordHash,
|
||||
masterPasswordHash: _masterPasswordHash
|
||||
};
|
||||
|
||||
$scope.updatePromise = apiService.accounts.putTwoFactor({}, request, function (response) {
|
||||
if (response.TwoFactorEnabled) {
|
||||
$analytics.eventTrack('Enabled Two-step Login');
|
||||
toastr.success('Two-step login has been enabled.');
|
||||
if (_profile.extended) _profile.extended.twoFactorEnabled = true;
|
||||
}
|
||||
else {
|
||||
$analytics.eventTrack('Disabled Two-step Login');
|
||||
toastr.success('Two-step login has been disabled.');
|
||||
if (_profile.extended) _profile.extended.twoFactorEnabled = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user