How to use the feathers-hooks-common.remove function in feathers-hooks-common

To help you get started, we’ve selected a few feathers-hooks-common examples, based on popular ways it is used in public projects.

github eddyystop / feathers-starter-react-redux-login-roles / server / services / user / hooks / index.js View on Github external
remove: [
      auth.verifyToken(),
      auth.populateUser(),
      auth.restrictToAuthenticated(),
      auth.restrictToOwner({ ownerField: idName }),
    ],
  };
};

exports.after = {
  find: [
    hooks.remove('password'),
    verifyHooks.removeVerification(),
  ],
  get: [
    hooks.remove('password'),
    verifyHooks.removeVerification(),
  ],
  create: [
    hooks.remove('password'),
    emailVerification, // send email to verify the email addr
    verifyHooks.removeVerification(),
  ],
  update: [
    hooks.remove('password'),
    verifyHooks.removeVerification(),
  ],
  patch: [
    hooks.remove('password'),
    verifyHooks.removeVerification(),
  ],
  remove: [
github eddyystop / feathers-starter-react-redux-login-roles / server / services / user / hooks / index.js View on Github external
auth.restrictToAuthenticated(),
    ],
    get: [
      auth.verifyToken(),
      auth.populateUser(),
      auth.restrictToAuthenticated(),
      auth.restrictToOwner({ ownerField: idName }),
    ],
    create: [
      validateSchema.form(schemas.signup, schemas.options), // schema validation
      hooks.validateSync(client.signup),  // redo redux-form client validation
      hooks.validateUsingPromise(values => verifyReset.create( // redo redux-form async
        { action: 'unique', value: { username: values.username, email: values.email } }
      )),
      hooks.validateUsingCallback(server.signup, { app }), // server validation
      hooks.remove('confirmPassword'),
      verifyHooks.addVerification(), // set email addr verification info
      auth.hashPassword(),
    ],
    update: [
      auth.verifyToken(),
      auth.populateUser(),
      auth.restrictToAuthenticated(),
      auth.restrictToOwner({ ownerField: idName }),
    ],
    patch: [ // client route /user/rolechange patches roles. todo might check its an admin acct
      auth.verifyToken(),
      auth.populateUser(),
      auth.restrictToAuthenticated(),
    ],
    remove: [
      auth.verifyToken(),
github axi-platform / legacy / api / src / services / account.js View on Github external
export default function accounts() {
  this.use("userstate", new UserStateService())
  this.use("accounts", new AccountService())

  this.service("userstate").after({
    all: [hooks.remove("password", "salt")]
  })
  this.service("accounts").after({
    all: [hooks.remove("password", "salt")]
  })
}
github phoomparin / FlipED / src / services / users.js View on Github external
get: [isRole(VIEW_USERS)],
    create: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
    remove: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
    update: [isRole(MODIFY_USERS), local.hooks.hashPassword()],
    patch: [isRole(MODIFY_USERS), local.hooks.hashPassword()]
  })

  /*
  this.service(USER).before({
    find: [hooks.iff()],
    get: [hooks.iff()]
  })
  */

  this.service(USER).after({
    all: [hooks.remove("password", "salt")],
    patch: [hooks.setUpdatedAt("updatedAt")],
    update: [hooks.setUpdatedAt("updatedAt")],
    create: [
      hooks.setCreatedAt("createdAt"),
      hooks.remove("roles", "meta")
    ]
  })
}
github phoomparin / FlipED / src / services / account.js View on Github external
export default function accounts() {
  this.use("userstate", new UserStateService())
  this.use("accounts", new AccountService())
  this.use("invitation", new InvitationService())

  this.service("userstate").after({
    all: [hooks.remove("password", "salt")]
  })
  this.service("accounts").after({
    all: [hooks.remove("password", "salt")]
  })
}
github phoomparin / FlipED / src / services / users.js View on Github external
})

  /*
  this.service(USER).before({
    find: [hooks.iff()],
    get: [hooks.iff()]
  })
  */

  this.service(USER).after({
    all: [hooks.remove("password", "salt")],
    patch: [hooks.setUpdatedAt("updatedAt")],
    update: [hooks.setUpdatedAt("updatedAt")],
    create: [
      hooks.setCreatedAt("createdAt"),
      hooks.remove("roles", "meta")
    ]
  })
}