nsarno / knock

Seamless JWT authentication for Rails API
MIT License
2.07k stars 253 forks source link

Make Rails 5.2.1 compatible #225

Closed kaliaabhishek closed 4 years ago

stevenmichaelthomas commented 5 years ago

You should try to update https://github.com/nsarno/knock/blob/66b60437a5acc28e4863f011ab59324dc1b5d0ae/lib/generators/templates/knock.rb

To make sure the proper default is referenced.

stevenmichaelthomas commented 5 years ago

Also, will this break for versions prior to Rails 5.2? If so, it may be good to add in a flag here to check rails version, or check for the existence of Rails.application.credentials

andrerpbts commented 4 years ago

Hello @kaliaabhishek

Are you still open to change this code? I'm asking because it could be useful if we improve a bit this part. Like was stated here https://github.com/nsarno/knock/issues/212, I think we could have an error code for when the credentials aren't provided to Knock, and identify the Rails version to select the default way. Of course, we should keep it simple to the people installing the gem in their projects to change it easily...

WDYT @nsarno?