1.0.2 • Published 7 years ago

user-manager-utils v1.0.2

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

User Manger Utils

Usage

const utils = require('user-manager-utils')

const password = 'myPass'

utils.encrypt(password).then(hash => {
  // do something with password hash
}).catch(e => {
  // do something with err
})

Or

utils.encrypt(password, (err, hash) => {
  if (err) {
    // do something with err
  }
  // do something with hash
})

API

utils.encrypt(password, [callback]) -> hash
utils.signToken(token, secret, [options], [callback]) -> token
utils.verifyToken(token, secret, [options], [callback]) -> decoded
utils.extractToken(req, [callback]) -> token