Rails 5.2 switched to credentials
heroturtle opened this issue · 3 comments
Rails 5.2 replaced secrets with credentials. Chapter 4 still uses secrets which is not best practice anymore.
Sorry, just found your example code in another repository which uses credentials. Maybe change the line:
SECRET_KEY = Rails.application.secrets.secret_key_base.to_s
in lib/json_web_token.rb
to something like Rails.application.credentials.dig(:secret.key_base).to_s
and change the introduction example password 'my_secret_key' to something like 'my_secret_credential'
Sorry for my late. Someone I think this per on market_place_api
project implement your need : https://github.com/madeindjs/market_place_api_6/pull/12/files .
Currently I not updated book but feel free to make a PR if you think this will be needed.