1
0
mirror of https://github.com/bitwarden/web synced 2025-12-11 22:03:21 +00:00

verify email

This commit is contained in:
Kyle Spearrin
2017-07-05 15:36:40 -04:00
parent 5d81ed6a96
commit b24f892f60
8 changed files with 74 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ angular
.module('bit.global')
.controller('mainController', function ($scope, $state, authService, appSettings, toastr, $window, $document,
cryptoService, $uibModal) {
cryptoService, $uibModal, apiService) {
var vm = this;
vm.bodyClass = '';
vm.usingControlSidebar = vm.openControlSidebar = false;
@@ -79,7 +79,19 @@ angular
};
$scope.verifyEmail = function () {
// TODO: send email api
if ($scope.sendingVerify) {
return;
}
$scope.sendingVerify = true;
apiService.accounts.verifyEmail({}, null).$promise.then(function () {
toastr.success('Verification email sent.');
$scope.sendingVerify = false;
$scope.verifyEmailSent = true;
}).catch(function () {
toastr.success('Verification email failed.');
$scope.sendingVerify = false;
});
};
// Append dropdown menu somewhere else