normalize email with lowercase
This commit is contained in:
parent
440032ed4a
commit
d49d2275d2
|
@ -26,10 +26,11 @@ angular
|
||||||
return;
|
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 = {
|
var request = {
|
||||||
name: $scope.model.name,
|
name: $scope.model.name,
|
||||||
email: $scope.model.email,
|
email: email,
|
||||||
masterPasswordHash: cryptoService.hashPassword($scope.model.masterPassword, key),
|
masterPasswordHash: cryptoService.hashPassword($scope.model.masterPassword, key),
|
||||||
masterPasswordHint: $scope.model.masterPasswordHint
|
masterPasswordHint: $scope.model.masterPasswordHint
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,6 +6,7 @@ angular
|
||||||
_userProfile = null;
|
_userProfile = null;
|
||||||
|
|
||||||
_service.logIn = function (email, masterPassword) {
|
_service.logIn = function (email, masterPassword) {
|
||||||
|
email = email.toLowerCase();
|
||||||
var key = cryptoService.makeKey(masterPassword, email);
|
var key = cryptoService.makeKey(masterPassword, email);
|
||||||
|
|
||||||
var request = {
|
var request = {
|
||||||
|
|
|
@ -9,14 +9,15 @@
|
||||||
|
|
||||||
$scope.token = function (model) {
|
$scope.token = function (model) {
|
||||||
_masterPasswordHash = cryptoService.hashPassword(model.masterPassword);
|
_masterPasswordHash = cryptoService.hashPassword(model.masterPassword);
|
||||||
|
var newEmail = model.newEmail.toLowerCase();
|
||||||
|
|
||||||
var request = {
|
var request = {
|
||||||
newEmail: model.newEmail,
|
newEmail: newEmail,
|
||||||
masterPasswordHash: _masterPasswordHash
|
masterPasswordHash: _masterPasswordHash
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.tokenPromise = apiService.accounts.emailToken(request, function () {
|
$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);
|
_newMasterPasswordHash = cryptoService.hashPassword(model.masterPassword, _newKey);
|
||||||
|
|
||||||
$scope.tokenSent = true;
|
$scope.tokenSent = true;
|
||||||
|
@ -41,7 +42,7 @@
|
||||||
$q.all([sitesPromise, foldersPromise]).then(function () {
|
$q.all([sitesPromise, foldersPromise]).then(function () {
|
||||||
var request = {
|
var request = {
|
||||||
token: model.token,
|
token: model.token,
|
||||||
newEmail: model.newEmail,
|
newEmail: model.newEmail.toLowerCase(),
|
||||||
masterPasswordHash: _masterPasswordHash,
|
masterPasswordHash: _masterPasswordHash,
|
||||||
newMasterPasswordHash: _newMasterPasswordHash,
|
newMasterPasswordHash: _newMasterPasswordHash,
|
||||||
ciphers: reencryptedSites.concat(reencryptedFolders)
|
ciphers: reencryptedSites.concat(reencryptedFolders)
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
$scope.processing = true;
|
$scope.processing = true;
|
||||||
|
|
||||||
var profile = authService.getUserProfile();
|
var profile = authService.getUserProfile();
|
||||||
var newKey = cryptoService.makeKey(model.newMasterPassword, profile.email);
|
var newKey = cryptoService.makeKey(model.newMasterPassword, profile.email.toLowerCase());
|
||||||
|
|
||||||
var reencryptedSites = [];
|
var reencryptedSites = [];
|
||||||
var sitesPromise = apiService.sites.list({ dirty: false }, function (encryptedSites) {
|
var sitesPromise = apiService.sites.list({ dirty: false }, function (encryptedSites) {
|
||||||
|
|
Loading…
Reference in New Issue