andrew-dixon / cb-jwt

ColdBox JSON Web Tokens (JWT)
https://www.forgebox.io/view/jwt
MIT License
7 stars 9 forks source link

Module settings for default key and algorithm #9

Open bdw429s opened 5 years ago

bdw429s commented 5 years ago

Would it make sense to introduce optional module settings to configure the default key and algorithm to use for all operations? That would simplify the API as I wouldn't have to pass in the key and algorithm every time I called the service.

moduleSettings = {
  jwt : {
    key : 'myKey',
    secretIsBase64 : true,
    algorithm : 'HS512'
  }
};

I can send over a pull for this if you like.

andrew-dixon commented 5 years ago

@bdw429s Sounds good, pull request away :-)