Skip to content

Instantly share code, notes, and snippets.

View anandundavia's full-sized avatar
🎯
Focusing

Anand Undavia anandundavia

🎯
Focusing
View GitHub Profile
} 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)
} else {
throw new UnsupporedOperationException();
}
}
}
} else {
throw new EmailPasswordMissMatchException();
}
}
}
function changePassword(email, oldPassword, newPassword) {
var user = getUser(email);
shouldChangePassword(user, oldPassword, newPassword);
if (user.isAdmin) {
changeAdminPassword(user, newPassword);
} else {
changeUserPassword(user, oldPassword, newPassword);
}
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) {
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) {
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) {
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) {