Skip to content

Instantly share code, notes, and snippets.

View Rowadz's full-sized avatar
🤙
🦖🦖

Mohammad Alrawad Rowadz

🤙
🦖🦖
View GitHub Profile
@psi-4ward
psi-4ward / auth.changePassword.js
Last active June 26, 2020 09:56
Feathers.js simple changePassword Service
const auth = require('@feathersjs/authentication');
const errors = require('@feathersjs/errors');
const bcrypt = require('bcryptjs');
const comparePasswords = (oldPassword, password) => new Promise((resolve, reject) => {
bcrypt.compare(oldPassword, password, (err, data1) => {
if(err || !data1) return reject();
return resolve();
});
});