How to use the @feathersjs/authentication-local.hooks.hashPassword function in @feathersjs/authentication-local

To help you get started, we’ve selected a few @feathersjs/authentication-local 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 feathers-plus / feathers-authentication-management / src / helpers.js View on Github external
const hashPassword = (app1, password) => {
  const hook = {
    type: 'before',
    data: { password },
    params: { provider: null },
    app: {
      get (str) {
        return app1.get(str);
      }
    }
  };

  return auth.hashPassword()(hook)
    .then(hook1 => hook1.data.password);
};