How to use the feathers-authentication-management.isVerified 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 Human-Connection / API / server / services / emotions / emotions.hooks.js View on Github external
const { authenticate } = require('@feathersjs/authentication').hooks;
const emotionRatingHook = require('./hooks/emotion-rating');
const { isVerified } = require('feathers-authentication-management').hooks;
const hooks = require('feathers-hooks-common');

module.exports = {
  before: {
    all: [authenticate('jwt')],
    find: [],
    get: [],
    create: [
      hooks.when(hooks.isProvider('external'),
        isVerified()
      )],
    update: [hooks.disallow()],
    patch: [hooks.disallow()],
    remove: [hooks.disallow('external')]
  },

  after: {
    all: [
      // populate({ schema: userSchema }),
      // populate({ schema: contributionSchema })
    ],
    find: [],
    get: [],
    create: [emotionRatingHook()],
    update: [],
    patch: [],
github Human-Connection / API / server / services / follows / follows.hooks.js View on Github external
childField: '_id',
    query: {
      $select: ['_id', 'name', 'slug', 'avatar', 'createdAt', 'lastActiveAt']
    }
  }
};

module.exports = {
  before: {
    all: [],
    find: [],
    get: [],
    create: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        associateCurrentUser()
      )
      // mapCreateToUpsert(context => {
      //   const { data } = context;
      //   return { userId: data.userId, foreignId: data.foreignId, foreignService: data.foreignService };
      // })
    ],
    update: [
      authenticate('jwt'),
      unless(isModerator(),
        restrictToOwner()
      )
    ],
    patch: [
      authenticate('jwt'),
      unless(isModerator(),
github Human-Connection / API / server / services / contributions / contributions.hooks.js View on Github external
authenticate('jwt'),
      // Allow seeder to seed contributions
      associateCurrentUser(),
      unless(isProvider('server'),
        isVerified(),
        canEditOrganization()
      ),
      associateCurrentUser(),
      createSlug({field: 'title'}),
      saveRemoteImages(['teaserImg']),
      createExcerpt()
    ],
    update: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        canEditOrganization()
      ),
      unless(isModerator(),
        excludeDisabled(),
        restrictToOwner()
      ),
      saveRemoteImages(['teaserImg']),
      createExcerpt(),
      setNow('updatedAt')
    ],
    patch: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        canEditOrganization()
      ),
github Human-Connection / API / server / services / comments / comments.hooks.js View on Github external
hook => {
        delete hook.params.query.deleted;
        return hook;
      }
    ],
    get: [
      iff(
        hook => hook.params.headers && hook.params.headers.authorization,
        authenticate('jwt')
      )
    ],
    create: [
      authenticate('jwt'),
      // Allow seeder to seed comments
      unless(isProvider('server'),
        isVerified()
      ),
      associateCurrentUser(),
      createExcerpt({ length: 180 })
    ],
    update: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        restrictToOwner()
      ),
      createExcerpt({ length: 180 }),
      setNow('updatedAt')
    ],
    patch: [
      authenticate('jwt'),
      unless(isProvider('server'),
github Human-Connection / API / server / services / users-candos / users-candos.hooks.js View on Github external
const {
  associateCurrentUser,
  restrictToOwner
} = require('feathers-authentication-hooks');
const { isVerified } = require('feathers-authentication-management').hooks;
const setDoneDate = require('./hooks/set-done-date');

module.exports = {
  before: {
    all: [],
    find: [],
    get: [],
    create: [
      unless(isProvider('server'),
        authenticate('jwt'),
        isVerified(),
        associateCurrentUser()
      ),
      setDoneDate()
    ],
    update: [
      authenticate('jwt'),
      unless(isModerator(),
        restrictToOwner()
      ),
      setDoneDate()
    ],
    patch: [
      authenticate('jwt'),
      unless(isModerator(),
        restrictToOwner()
      ),
github Human-Connection / API / server / services / system-notifications / system-notifications.hooks.js View on Github external
const { unless, isProvider } = require('feathers-hooks-common');
const { isVerified } = require('feathers-authentication-management').hooks;
const { authenticate } = require('@feathersjs/authentication').hooks;
const isAdmin = require('../../hooks/is-admin');

module.exports = {
  before: {
    all: [],
    find: [],
    get: [],
    create: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        isAdmin()
      )
    ],
    update: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        isAdmin()
      )
    ],
    patch: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        isAdmin()
      )
github Human-Connection / API / server / services / shouts / shouts.hooks.js View on Github external
const setShoutCount = require('./hooks/set-shout-count');
const {
  associateCurrentUser,
  restrictToOwner
} = require('feathers-authentication-hooks');
const { isVerified } = require('feathers-authentication-management').hooks;

module.exports = {
  before: {
    all: [],
    find: [],
    get: [],
    create: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        associateCurrentUser()
      )
    ],
    update: [
      authenticate('jwt'),
      unless(isModerator(),
        restrictToOwner()
      )
    ],
    patch: [
      authenticate('jwt'),
      unless(isModerator(),
        restrictToOwner()
      )
    ],
    remove: [
github Human-Connection / API / server / services / pages / pages.hooks.js View on Github external
.replace(/<[a-z]>[\s]*<\/[a-z]>/igm, '')
      .replace(/<p>[\s]*(<br>)+[\s]*&lt;\/p&gt;/igm, '<br>')
      .replace(/(<br>){2,}/igm, '<br>')
      .replace(/[\n]{3,}/igm, '\n\n');
  };
};

module.exports = {
  before: {
    all: [],
    find: [],
    get: [],
    create: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        isAdmin()
      ),
      createSlug({ field: 'key', unique: false }),
      cleanupHTML()
    ],
    update: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified(),
        isAdmin()
      ),
      cleanupHTML()
    ],
    patch: [
      authenticate('jwt'),
      unless(isProvider('server'),</p>
github Human-Connection / API / server / services / organizations / organizations.hooks.js View on Github external
),
      when(isModerator(),
        hook => {
          hook.data.reviewedBy = hook.params.user.userId;
          return hook;
        }
      ),
      associateCurrentUser(),
      createSlug({ field: 'name' }),
      createExcerpt({ field: 'description' }),
      saveRemoteImages(['logo', 'coverImg'])
    ],
    update: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified()
      ),
      stashBefore(),
      restrictReviewAndEnableChange(),
      restrictToOwnerOrModerator({ isEnabled: true }),
      createSlug({ field: 'name', overwrite: true }),
      createExcerpt({ field: 'description' }),
      saveRemoteImages(['logo', 'coverImg'])
    ],
    patch: [
      authenticate('jwt'),
      unless(isProvider('server'),
        isVerified()
      ),
      stashBefore(),
      restrictReviewAndEnableChange(),
      restrictToOwnerOrModerator({ isEnabled: true }),

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