From 355d8f584361fef3e5a605a94cda584cc2d03d68 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 5 Sep 2020 15:06:31 -0600 Subject: [PATCH] Update openid_credentials Widget API action for MSC1960 updates We now need to send a `state` and `original_request_id` per MSC1960's recent adjustments --- src/WidgetMessaging.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/WidgetMessaging.js b/src/WidgetMessaging.js index 6aed08c39d..56ee96ab21 100644 --- a/src/WidgetMessaging.js +++ b/src/WidgetMessaging.js @@ -186,7 +186,14 @@ export default class WidgetMessaging { isUserWidget: this.isUserWidget, onFinished: async (confirm) => { - const responseBody = {success: confirm}; + const responseBody = { + // Legacy (early draft) fields + success: confirm, + + // New style MSC1961 fields + state: confirm ? "allowed" : "blocked", + original_request_id: ev.requestId, // eslint-disable-line camelcase + }; if (confirm) { const credentials = await MatrixClientPeg.get().getOpenIdToken(); Object.assign(responseBody, credentials);