Skip to content

Commit

Permalink
Add wrapping to exchange endpoint response
Browse files Browse the repository at this point in the history
As discussed here:
#10095 (comment)
  • Loading branch information
backspace committed Feb 26, 2021
1 parent 9c403e5 commit 106abe5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ui/app/adapters/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export default class TokenAdapter extends ApplicationAdapter {
return this.ajax(`${this.buildURL()}/token/onetime/exchange`, 'POST', {
data: {
OneTimeSecret: oneTimeToken,
}}).then(token => {
},
}).then(({ Token: token }) => {
const store = this.store;
store.pushPayload('token', {
tokens: [token],
Expand Down
6 changes: 4 additions & 2 deletions ui/mirage/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ export default function() {

// Return the token if it exists
if (tokenForSecret) {
return this.serialize(tokenForSecret);
return {
Token: this.serialize(tokenForSecret),
};
}

// Forbidden error if it doesn't
Expand Down Expand Up @@ -436,7 +438,7 @@ export default function() {
return {
License: {
Features: records.models.mapBy('name'),
}
},
};
}

Expand Down

0 comments on commit 106abe5

Please sign in to comment.