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

qr code size and clean token on delete

This commit is contained in:
Kyle Spearrin
2017-08-15 08:24:14 -04:00
parent 995fc96a5d
commit 2772bffd09
3 changed files with 10 additions and 4 deletions

View File

@@ -2,16 +2,22 @@
.module('bit.settings') .module('bit.settings')
.controller('settingsDeleteController', function ($scope, $state, apiService, $uibModalInstance, cryptoService, .controller('settingsDeleteController', function ($scope, $state, apiService, $uibModalInstance, cryptoService,
authService, toastr, $analytics) { authService, toastr, $analytics, tokenService) {
$analytics.eventTrack('settingsDeleteController', { category: 'Modal' }); $analytics.eventTrack('settingsDeleteController', { category: 'Modal' });
$scope.submit = function (model) { $scope.submit = function (model) {
$scope.submitPromise = cryptoService.hashPassword(model.masterPassword).then(function (hash) { var profile;
$scope.submitPromise = authService.getUserProfile().then(function (theProfile) {
profile = theProfile;
return cryptoService.hashPassword(model.masterPassword);
}).then(function (hash) {
return apiService.accounts.postDelete({ return apiService.accounts.postDelete({
masterPasswordHash: hash masterPasswordHash: hash
}).$promise; }).$promise;
}).then(function () { }).then(function () {
$uibModalInstance.dismiss('cancel'); $uibModalInstance.dismiss('cancel');
authService.logOut(); authService.logOut();
tokenService.clearTwoFactorToken(profile.email);
$analytics.eventTrack('Deleted Account'); $analytics.eventTrack('Deleted Account');
return $state.go('frontend.login.info'); return $state.go('frontend.login.info');
}).then(function () { }).then(function () {

View File

@@ -44,7 +44,7 @@
$scope.model = { $scope.model = {
key: formatString(_key), key: formatString(_key),
qr: 'https://chart.googleapis.com/chart?chs=120x120&chld=L|0&cht=qr&chl=otpauth://totp/' + qr: 'https://chart.googleapis.com/chart?chs=123x123&chld=L|0&cht=qr&chl=otpauth://totp/' +
_issuer + ':' + encodeURIComponent(_profile.email) + _issuer + ':' + encodeURIComponent(_profile.email) +
'%3Fsecret=' + encodeURIComponent(_key) + '%3Fsecret=' + encodeURIComponent(_key) +
'%26issuer=' + _issuer '%26issuer=' + _issuer

View File

@@ -75,7 +75,7 @@
<h4 ng-if="!enabled" style="margin-top: 30px;">2. Scan this QR code with your authenticator app</h4> <h4 ng-if="!enabled" style="margin-top: 30px;">2. Scan this QR code with your authenticator app</h4>
<div class="row"> <div class="row">
<div class="col-md-4 text-center"> <div class="col-md-4 text-center">
<p><img ng-src="{{model.qr}}" alt="QR" class="img-thumbnail" /></p> <p><img ng-src="{{model.qr}}" alt="QR" /></p>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<p> <p>