This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} else { | |
throw new UnsupporedOperationException(); | |
} // CLOSE: if (user.isEnabled) | |
} // CLOSE: if (user.isAdmin) | |
} // CLOSE: if (oldPasswordDecrypted === newPasswordDecrypted) | |
} else { | |
throw new EmailPasswordMissMatchException(); | |
} // CLOSE: if (existingPasswordDecrypted === oldPasswordDecrypted) | |
} // CLOSE: if (user === null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} else { | |
throw new UnsupporedOperationException(); | |
} | |
} | |
} | |
} else { | |
throw new EmailPasswordMissMatchException(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changePassword(email, oldPassword, newPassword) { | |
var user = getUser(email); | |
shouldChangePassword(user, oldPassword, newPassword); | |
if (user.isAdmin) { | |
changeAdminPassword(user, newPassword); | |
} else { | |
changeUserPassword(user, oldPassword, newPassword); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changePassword(email, oldPassword, newPassword) { | |
var user = getUser(email); | |
var oldPasswordDecrypted = decrypt(oldPassword) | |
var newPasswordDecrypted = decrypt(newPassword) | |
var existingPasswordDecrypted = decrypt(user.password) | |
if (user === null || existingPasswordDecrypted !== oldPasswordDecrypted) { | |
throw new EmailPasswordMissMatchException(); | |
} | |
if (oldPasswordDecrypted === newPasswordDecrypted) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changePassword(email, oldPassword, newPassword) { | |
var user = getUser(email); | |
var oldPasswordDecrypted = decrypt(oldPassword) | |
var newPasswordDecrypted = decrypt(newPassword) | |
var existingPasswordDecrypted = decrypt(user.password) | |
if (user === null || existingPasswordDecrypted !== oldPasswordDecrypted) { | |
throw new EmailPasswordMissMatchException(); | |
} | |
if (oldPasswordDecrypted === newPasswordDecrypted) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changePassword(email, oldPassword, newPassword) { | |
var user = getUser(email); | |
var oldPasswordDecrypted = decrypt(oldPassword) | |
var newPasswordDecrypted = decrypt(newPassword) | |
var existingPasswordDecrypted = decrypt(user.password) | |
if (user === null || existingPasswordDecrypted !== oldPasswordDecrypted) { | |
throw new EmailPasswordMissMatchException(); | |
} | |
if (oldPasswordDecrypted === newPasswordDecrypted) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changePassword(email, oldPassword, newPassword) { | |
var user = getUser(email); | |
var oldPasswordDecrypted = decrypt(oldPassword) | |
var newPasswordDecrypted = decrypt(newPassword) | |
if (user === null) { | |
throw new EmailPasswordMissMatchException(); | |
} else { | |
var existingPasswordDecrypted = decrypt(user.password) | |
if (existingPasswordDecrypted === oldPasswordDecrypted) { |