- add: createPushSubscription :

'Subscribed to FreePlanet.app!',
  'You can now receive Notification and Messages.'
This commit is contained in:
Paolo Arena
2019-02-05 18:17:44 +01:00
parent 8e5e7addb7
commit db2a460594
11 changed files with 38 additions and 42 deletions

View File

@@ -82,7 +82,7 @@ UserSchema.methods.toJSON = function () {
};
UserSchema.methods.generateAuthToken = function () {
console.log("GENERA TOKEN : ");
// console.log("GENERA TOKEN : ");
var user = this;
var access = 'auth';
var token = jwt.sign({ _id: user._id.toHexString(), access }, process.env.SIGNCODE).toString();
@@ -130,8 +130,8 @@ UserSchema.statics.findByCredentials = function (username, password) {
return new Promise((resolve, reject) => {
// Use bcrypt.compare to compare password and user.password
console.log("pwd1 " + password);
console.log("pwd2 " + pwd);
// console.log("pwd1 " + password);
// console.log("pwd2 " + pwd);
bcrypt.compare(password, pwd, (err, res) => {
if (res) {
resolve(user);