trailsjs / sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
https://www.npmjs.org/package/sails-auth
MIT License
266 stars 141 forks source link

how to extend the user model? #110

Closed toddgeist closed 8 years ago

toddgeist commented 8 years ago

Is there a way to extend the User model with additional Attributes?

toddgeist commented 8 years ago

answering my own question...

in api/models/User.js just add the additional attributes you want. Like this

module.exports = {
  attributes: {

    // here's an additional field
    additionalField : {
      type : 'string',
      defaultsTo :'ok'
    }

  }
}
tjwebb commented 8 years ago

just add the additional attributes you want. Like this

yep!