Secure a Rails API with Auth0

Hey, thanks for sharing this amazing guide!

Three things to point out:

  1. In Rails 6, if you put lib files under app/lib they are autoloaded, meaning you don’t have to load them manually in the ApplicationController.
  2. Rails.application.config.x.auth0 was returning an empty hash in my case, so I had to do: Rails.application.config_for(:auth0)[:Key-I-Need]
  3. I had some issues decoding the token, so for me on JWT.decode instead of iss: Rails.application.config.x.auth0.issuerUri, I used issuer: issuer,