How to use the bcrypt-nodejs.compareSync function in bcrypt-nodejs

To help you get started, we’ve selected a few bcrypt-nodejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iiimosley / GoodQuotes / api / config / passport-strat.js View on Github external
const isValidPassword = (userpass, password) => {
      console.log('isValidPassword', userpass, password);

      // hashes the passed-in password and then compares it to the hashed password fetched from the db
      return bCrypt.compareSync(password, userpass);
    };
github iiimosley / GoodQuotes / api / config / passport.js View on Github external
const isValidPassword = (userpass, password) => {
      // hashes the passed-in password and then compares it to the hashed password fetched from the db
      return bCrypt.compareSync(password, userpass);
    };
github punchcard-cms / punchcard / lib / init / passport.js View on Github external
.then(user => {
    if ((user.length < 1) || (!bcrypt.compareSync(password, user[0].password))) {
      return cb(null, false, { message: config.authentication.messages.login.error });
    }

    // register user's role for access
    acl.addUserRoles(user[0].id.toString(), user[0].role);

    return cb(null, user[0].id);
  })
  .catch(err => {
github yegor-sytnyk / contoso-express / server / src / repositories / userRepository.ts View on Github external
.then((user) => {
            let actualPassword = user.profile.local.password;

            return bcrypt.compareSync(password, actualPassword);
        });
}
github nmaro / ooth / packages / ooth-local / src / index.js View on Github external
}).then(user => {
                    if (!user) {
                        throw new Error(__('login.no_user', null, req.locale))
                    }

                    if (!user[name]) {
                        throw new Error(__('login.no_password', null, req.locale))
                    }

                    if (!compareSync(password, user[name].password)) {
                        throw new Error(__('login.invalid_password', null, req.locale))
                    }

                    return user
                })
        })))

bcrypt-nodejs

A native JS bcrypt library for NodeJS.

Unknown
Latest version published 12 years ago

Package Health Score

39 / 100
Full package analysis