From 355d8f584361fef3e5a605a94cda584cc2d03d68 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 5 Sep 2020 15:06:31 -0600 Subject: [PATCH 1/2] 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); From db1eb895525f5c6c30d42cfba8c1c10a09cf4f9e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 5 Sep 2020 15:10:28 -0600 Subject: [PATCH 2/2] MSC numbers are hard to remember --- src/WidgetMessaging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WidgetMessaging.js b/src/WidgetMessaging.js index 56ee96ab21..c68e926ac1 100644 --- a/src/WidgetMessaging.js +++ b/src/WidgetMessaging.js @@ -190,7 +190,7 @@ export default class WidgetMessaging { // Legacy (early draft) fields success: confirm, - // New style MSC1961 fields + // New style MSC1960 fields state: confirm ? "allowed" : "blocked", original_request_id: ev.requestId, // eslint-disable-line camelcase };