Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Set JWT auth token "sub" field by basic auth username instead of "account" HTTP GET parameter #2286

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/api/v2/tokens_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def show
auth_scopes = []
auth_scopes = authorize_scopes(registry) unless registry.nil?

token = Portus::JwtToken.new(params[:account], params[:service], auth_scopes)
token = Portus::JwtToken.new(current_user.username, params[:service], auth_scopes)
logger.tagged("jwt_token", "claim") { logger.debug token.claim }
render json: token.encoded_hash
end
Expand Down