1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-05 05:17:40 +02: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')
.controller('settingsDeleteController', function ($scope, $state, apiService, $uibModalInstance, cryptoService,
authService, toastr, $analytics) {
authService, toastr, $analytics, tokenService) {
$analytics.eventTrack('settingsDeleteController', { category: 'Modal' });
$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({
masterPasswordHash: hash
}).$promise;
}).then(function () {
$uibModalInstance.dismiss('cancel');
authService.logOut();
tokenService.clearTwoFactorToken(profile.email);
$analytics.eventTrack('Deleted Account');
return $state.go('frontend.login.info');
}).then(function () {

View File

@ -44,7 +44,7 @@
$scope.model = {
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) +
'%3Fsecret=' + encodeURIComponent(_key) +
'%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>
<div class="row">
<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 class="col-md-8">
<p>