OrlSan / sails-hook-kimyjwt

JWT-based authentication in Sails.js, for humans.
MIT License
3 stars 0 forks source link

Multi model configuration. #1

Open eseca opened 8 years ago

eseca commented 8 years ago

For an application where multiple actors need to authenticate using JWT, you would need a way to tell the route which model is storing the secret.

sanjorgek commented 8 years ago

An easy way to solve this is:

module.exports.kimyjwt = {
  models: [
    {
      model: "user",
      secretField: "secret",
      idField: "id", // This is an attribute in the model
    }
  ]
}

And async help with replication of the polices settings