ndabAP / vue-sails-example

NOT MAINTAINED Vue.js with Sails.js example project with many features

Home Page:https://vue-sails-example.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix: Hide user password at response

ndabAP opened this issue · comments

E. g., products API endpoint returns users passwords.

Hi, i don't know if this is still a problem, but you might be able to add a setting function at the bottom of the api > models > user.js file such as :

// Return a shallow copy of this record with certain attributes removed at each request
customToJSON () {
    return _.omit(this, ['password']);
}

More info, here.

Hey @qvdp, yeah, this is still a problem. I guess I tried your solution some time ago and it didn't work. But I'll try it again.

Would it be possible for you to provide the full file user.js?