Merge pull request #5172 from matrix-org/travis/widgets/msc1960-1

Update openid_credentials Widget API action for MSC1960 updates
This commit is contained in:
Travis Ralston 2020-09-08 07:20:35 -06:00 committed by GitHub
commit 5c878ddfdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,7 +186,14 @@ export default class WidgetMessaging {
isUserWidget: this.isUserWidget, isUserWidget: this.isUserWidget,
onFinished: async (confirm) => { onFinished: async (confirm) => {
const responseBody = {success: confirm}; const responseBody = {
// Legacy (early draft) fields
success: confirm,
// New style MSC1960 fields
state: confirm ? "allowed" : "blocked",
original_request_id: ev.requestId, // eslint-disable-line camelcase
};
if (confirm) { if (confirm) {
const credentials = await MatrixClientPeg.get().getOpenIdToken(); const credentials = await MatrixClientPeg.get().getOpenIdToken();
Object.assign(responseBody, credentials); Object.assign(responseBody, credentials);