Skip to content

Commit

Permalink
Fixes token access path. (#16519)
Browse files Browse the repository at this point in the history
Related to department-of-veterans-affairs/va.gov-team#73503

The BTSSS API token response structure has changed. This PR updates
the way we get the token from the repsonse accordingly.
  • Loading branch information
kjduensing committed Apr 26, 2024
1 parent 4dfb07e commit a59f116
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/travel_pay/app/services/travel_pay/client.rb
Expand Up @@ -37,7 +37,8 @@ def request_btsss_token(veis_token, sts_token)
req.headers['BTSSS-API-Client-Number'] = client_number.to_s
req.body = { authJwt: sts_token }
end
response.body['access_token']

response.body['data']['accessToken']
end

##
Expand Down
2 changes: 1 addition & 1 deletion modules/travel_pay/spec/services/client_spec.rb
Expand Up @@ -44,7 +44,7 @@
[
200,
{ 'Content-Type': 'application/json' },
'{"access_token": "fake_btsss_token"}'
'{"data": {"accessToken": "fake_btsss_token"}}'
]
end

Expand Down

0 comments on commit a59f116

Please sign in to comment.