Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socker.js | Custom successHandler #271

Closed
JigsWeb opened this Issue Aug 15, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@JigsWeb
Copy link

JigsWeb commented Aug 15, 2016

File: https://github.com/feathersjs/feathers-authentication/blob/0.8/src/middleware/sockets.js
Line: 25

When I authenticated a user, I want to remove his password, it is posssible to make a custom 'successHandler' ?

PS: I use FA for one days so be indulgent :D

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Aug 15, 2016

I thought it does that already but you can modify the returned data yourself with a hook after the authentication service.

app.service('auth/local').after(hook => {
  if(hook.result.data.user && hook.result.data.user.password) {
    delete hook.result.data.user.password;
  }
});

@daffl daffl closed this Aug 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.