How to use the feathers-authentication-management.hooks.addVerification function in feathers-authentication-management

To help you get started, we’ve selected a few feathers-authentication-management 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 codingfriend1 / Feathers-Vue / src / services / user / hooks / index.js View on Github external
auth.restrictToAuthenticated(),
    globalHooks.isEnabled(),
    globalHooks.hasPermission('manageUsers')
  ],
  get: [
    auth.verifyToken(),
    auth.populateUser(),
    auth.restrictToAuthenticated(),
    globalHooks.isEnabled(),
    globalHooks.hasPermission('manageUsers')
    // auth.restrictToOwner({ ownerField: '_id' })
  ],
  create: [
    auth.hashPassword(),
    common.lowerCase('email'),
    verifyHooks.addVerification(),
    globalHooks.setDefaultRole(),
    globalHooks.setFirstUserToRole({role: 'admin'})
  ],
  update: [
    auth.verifyToken(),
    auth.populateUser(),
    auth.restrictToAuthenticated(),
    globalHooks.isEnabled(),
    globalHooks.hasPermissionOrRestrictChanges('manageUsers', {
      restrictOn: ['role', 'isEnabled']
    }),
    globalHooks.preventDisabledAdmin()
  ],
  patch: [
    auth.verifyToken(),
    auth.populateUser(),
github ImreC / feathers-verification-emails / src / services / users / users.hooks.js View on Github external
const verifyHooks = require('feathers-authentication-management').hooks;
const accountService = require('../authmanagement/notifier');
const commonHooks = require('feathers-hooks-common');

const {
  hashPassword, protect
} = require('@feathersjs/authentication-local').hooks;

module.exports = {
  before: {
    all: [],
    find: [ authenticate('jwt') ],
    get: [ authenticate('jwt') ],
    create: [
      hashPassword(),
      verifyHooks.addVerification()
    ],
    update: [
      commonHooks.disallow('external')
    ],
    patch: [
      commonHooks.iff(
        commonHooks.isProvider('external'),
          commonHooks.preventChanges(true,
            ['email',
            'isVerified',
            'verifyToken',
            'verifyShortToken',
            'verifyExpires',
            'verifyChanges',
            'resetToken',
            'resetShortToken',
github codingfriend1 / Feathers-Vue / server / services / users / users.hooks.js View on Github external
};

module.exports = {
  before: {
    all: [],
    find: [ 
      authenticate('jwt'),
      isEnabled(),
    ],
    get: [ 
      authenticate('jwt'),
      isEnabled(),
    ],
    create: [ 
      hashPassword(),
      verifyHooks.addVerification(),
      setDefaultRole(),
      setFirstUserToRole({role: 'admin'}),
      preventDisabledAdmin(),
      loopItems(setUserInitials)
    ],
    update: [ 
      commonHooks.disallow('external')
    ],
    patch: [ 
      ...restrict,
      commonHooks.iff(commonHooks.isProvider('external'), commonHooks.preventChanges(
        'email',
        'isVerified',
        'verifyToken',
        'verifyShortToken',
        'verifyExpires',

feathers-authentication-management

Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication

MIT
Latest version published 6 months ago

Package Health Score

77 / 100
Full package analysis