lib/generators/templates/knock.rb in knock-1.1.0 vs lib/generators/templates/knock.rb in knock-1.2.0

- old
+ new

@@ -1,7 +1,18 @@ Knock.setup do |config| + ## Current user retrieval when validating token + ## -------------------------------------------- + ## + ## This is how you can tell Knock how to retrieve the current_user. + ## By default, it assumes you have a model called `User` and that + ## the user_id is stored in the 'sub' claim. + ## + ## Default: + # config.current_user_from_token = -> (claims) { User.find claims['sub'] } + + ## Expiration claim ## ---------------- ## ## How long before a token is expired. ## @@ -29,8 +40,8 @@ ## ## Default: # config.token_secret_signature_key = -> { Rails.application.secrets.secret_key_base } ## If using Auth0, uncomment the line below - # config.token_secret_signature_key = -> { Rails.application.secrets.auth0_client_secret } + # config.token_secret_signature_key = -> { JWT.base64url_decode Rails.application.secrets.auth0_client_secret } end