Skip to content

Instantly share code, notes, and snippets.

@ImreC
Created February 18, 2018 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ImreC/901ec66f3d6a6ec3707d9f51e510cddc to your computer and use it in GitHub Desktop.
Save ImreC/901ec66f3d6a6ec3707d9f51e510cddc to your computer and use it in GitHub Desktop.
before: {
all: [],
find: [ authenticate('jwt') ],
get: [ authenticate('jwt') ],
create: [
hashPassword(),
verifyHooks.addVerification()
],
update: [
commonHooks.disallow('external')
],
patch: [
commonHooks.iff(
commonHooks.isProvider('external'),
commonHooks.preventChanges(
'email',
'isVerified',
'verifyToken',
'verifyShortToken',
'verifyExpires',
'verifyChanges',
'resetToken',
'resetShortToken',
'resetExpires'
),
hashPassword(),
authenticate('jwt')
)
],
remove: [ authenticate('jwt') ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment