Resolve conflicts
This commit is contained in:
parent
281b388e39
commit
bfc193d8cd
308 changed files with 3045 additions and 3200 deletions
|
|
@ -13,13 +13,13 @@ import User from '../../models/user';
|
|||
* @return {Promise<any>}
|
||||
*/
|
||||
module.exports = async (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'current_password' parameter
|
||||
const [currentPassword, currentPasswordErr] = $(params.current_password).string().$;
|
||||
if (currentPasswordErr) return rej('invalid current_password param');
|
||||
// Get 'currentPasword' parameter
|
||||
const [currentPassword, currentPasswordErr] = $(params.currentPasword).string().$;
|
||||
if (currentPasswordErr) return rej('invalid currentPasword param');
|
||||
|
||||
// Get 'new_password' parameter
|
||||
const [newPassword, newPasswordErr] = $(params.new_password).string().$;
|
||||
if (newPasswordErr) return rej('invalid new_password param');
|
||||
// Get 'newPassword' parameter
|
||||
const [newPassword, newPasswordErr] = $(params.newPassword).string().$;
|
||||
if (newPasswordErr) return rej('invalid newPassword param');
|
||||
|
||||
// Compare password
|
||||
const same = await bcrypt.compare(currentPassword, user.account.password);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue