Skip to content

helpme #7

Description

@rofiuddin15

I use it on feathersjs, but it doesn't work, what if I use it on feathersjs
this my code

`const { authenticate } = require('@feathersjs/authentication').hooks;
var hashers = require('node-django-hashers');

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

var hashPassword = new hashers.PBKDF2SHA1PasswordHasher();

module.exports = {
before: {
all: [],
find: [ authenticate('jwt') ],
get: [ authenticate('jwt') ],
create: [ hashPassword.encode() ],
update: [ hashPassword.encode(), authenticate('jwt') ],
patch: [ hashPassword.encode(), authenticate('jwt') ],
remove: [ authenticate('jwt') ]
},

after: {
all: [
// Make sure the password field is never sent to the client
// Always must be the last hook
// protect('password')
],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
},

error: {
all: [],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
}
};`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions