Skip to content

Commit

Permalink
Enabling JWT support using the Rails secret key base
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgriffiniii committed Feb 28, 2020
1 parent 0c414bf commit 5e01b5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/browse_everything/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def build_json_web_token(authorization)
}

# @todo This needs to be shared with the client
JWT.encode(payload, 'secret', 'none')
JWT.encode(payload, Rails.application.secrets.secret_key_base, 'HS256')
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def token_data
def json_web_tokens
return [] unless token_data

# @todo This needs to be shared with the client
@json_web_tokens ||= JWT.decode(token_data, 'secret', false)
@json_web_tokens ||= JWT.decode(token_data, Rails.application.secrets.secret_key_base, false, { algorithm: 'HS256' })
end

# @return [Array<Hash>] the set of serialized Authorizations transmitted
Expand Down

0 comments on commit 5e01b5c

Please sign in to comment.