Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Socker.js | Custom successHandler #271

Closed
ghost opened this issue Aug 15, 2016 · 1 comment
Closed

Socker.js | Custom successHandler #271

ghost opened this issue Aug 15, 2016 · 1 comment

Comments

@ghost
Copy link

ghost 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
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 as completed Aug 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant