Skip to content

Commit

Permalink
[bug] changed using JWT.base64url_decode method because it does not e…
Browse files Browse the repository at this point in the history
…xist at up-to-date version of knock library
  • Loading branch information
vmartynets committed Mar 5, 2016
1 parent e4bb5a9 commit b78809f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion articles/server-apis/rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ config.token_audience = -> { Rails.application.secrets.auth0_client_id }
```

```ruby
config.token_secret_signature_key = -> { JWT.base64url_decode Rails.application.secrets.auth0_client_secret }
require 'base64'
# extracted from original [method](http://www.rubydoc.info/github/jwt/ruby-jwt/JWT.base64url_decode)
config.token_secret_signature_key = -> {
secret = Rails.application.secrets.auth0_client_secret
secret += '=' * (4 - secret.length.modulo(4))
Base64.decode64(secret.tr('-_', '+/'))
}
```

### 4. You're done!
Expand Down

0 comments on commit b78809f

Please sign in to comment.