normalize email with lowercase

This commit is contained in:
Kyle Spearrin 2016-10-10 22:40:44 -04:00
parent 440032ed4a
commit d49d2275d2
4 changed files with 9 additions and 6 deletions

View File

@ -26,10 +26,11 @@ angular
return;
}
var key = cryptoService.makeKey($scope.model.masterPassword, $scope.model.email);
var email = $scope.model.email.toLowerCase();
var key = cryptoService.makeKey($scope.model.masterPassword, email);
var request = {
name: $scope.model.name,
email: $scope.model.email,
email: email,
masterPasswordHash: cryptoService.hashPassword($scope.model.masterPassword, key),
masterPasswordHint: $scope.model.masterPasswordHint
};

View File

@ -6,6 +6,7 @@ angular
_userProfile = null;
_service.logIn = function (email, masterPassword) {
email = email.toLowerCase();
var key = cryptoService.makeKey(masterPassword, email);
var request = {

View File

@ -9,14 +9,15 @@
$scope.token = function (model) {
_masterPasswordHash = cryptoService.hashPassword(model.masterPassword);
var newEmail = model.newEmail.toLowerCase();
var request = {
newEmail: model.newEmail,
newEmail: newEmail,
masterPasswordHash: _masterPasswordHash
};
$scope.tokenPromise = apiService.accounts.emailToken(request, function () {
_newKey = cryptoService.makeKey(model.masterPassword, model.newEmail);
_newKey = cryptoService.makeKey(model.masterPassword, newEmail);
_newMasterPasswordHash = cryptoService.hashPassword(model.masterPassword, _newKey);
$scope.tokenSent = true;
@ -41,7 +42,7 @@
$q.all([sitesPromise, foldersPromise]).then(function () {
var request = {
token: model.token,
newEmail: model.newEmail,
newEmail: model.newEmail.toLowerCase(),
masterPasswordHash: _masterPasswordHash,
newMasterPasswordHash: _newMasterPasswordHash,
ciphers: reencryptedSites.concat(reencryptedFolders)

View File

@ -25,7 +25,7 @@
$scope.processing = true;
var profile = authService.getUserProfile();
var newKey = cryptoService.makeKey(model.newMasterPassword, profile.email);
var newKey = cryptoService.makeKey(model.newMasterPassword, profile.email.toLowerCase());
var reencryptedSites = [];
var sitesPromise = apiService.sites.list({ dirty: false }, function (encryptedSites) {