From bb0d0fc515aa60ed4cb17cebfd2bedb1e10056f9 Mon Sep 17 00:00:00 2001 From: olivier Date: Tue, 22 Nov 2022 17:05:50 +0100 Subject: [PATCH 1/2] add patch to remove authorization header --- patches/patches.json | 6 ++++++ .../matrix-react-sdk+3.59.0.patch | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch diff --git a/patches/patches.json b/patches/patches.json index a4b3951d2d..ba5ef02e00 100644 --- a/patches/patches.json +++ b/patches/patches.json @@ -145,5 +145,11 @@ "src/components/views/rooms/EventTile.tsx", "res/css/views/elements/_TooltipButton.pcss" ] + }, + "remove-authorization-header-in-reset-password": { + "package": "matrix-react-sdk", + "files": [ + "src/PasswordReset.ts" + ] } } diff --git a/patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch b/patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch new file mode 100644 index 0000000000..b95c87052b --- /dev/null +++ b/patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch @@ -0,0 +1,16 @@ +diff --git a/node_modules/matrix-react-sdk/src/PasswordReset.ts b/node_modules/matrix-react-sdk/src/PasswordReset.ts +index df812ba..a92e1aa 100644 +--- a/node_modules/matrix-react-sdk/src/PasswordReset.ts ++++ b/node_modules/matrix-react-sdk/src/PasswordReset.ts +@@ -42,6 +42,11 @@ export default class PasswordReset { + this.client = createClient({ + baseUrl: homeserverUrl, + idBaseUrl: identityUrl, ++ //:tchap: specify useAuthorization header to false to avoid this bug : ++ //https://github.com/tchapgouv/tchap-web-v4/issues/311 ++ //very strange this regression ++ //if we do not set it to false, a Authorization Bearer token undefined is sent to the server ++ useAuthorizationHeader: false + }); + this.clientSecret = this.client.generateClientSecret(); + } From 3533f3d2b97d4f55a1d82ca81cc156c969fe1342 Mon Sep 17 00:00:00 2001 From: Estelle Comment Date: Wed, 23 Nov 2022 11:21:46 +0100 Subject: [PATCH 2/2] More comments in patch --- .../matrix-react-sdk+3.59.0.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch b/patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch index b95c87052b..140fe62b3f 100644 --- a/patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch +++ b/patches/remove-authorization-header-in-reset-password/matrix-react-sdk+3.59.0.patch @@ -1,16 +1,17 @@ diff --git a/node_modules/matrix-react-sdk/src/PasswordReset.ts b/node_modules/matrix-react-sdk/src/PasswordReset.ts -index df812ba..a92e1aa 100644 +index df812ba..1020aff 100644 --- a/node_modules/matrix-react-sdk/src/PasswordReset.ts +++ b/node_modules/matrix-react-sdk/src/PasswordReset.ts -@@ -42,6 +42,11 @@ export default class PasswordReset { +@@ -42,6 +42,12 @@ export default class PasswordReset { this.client = createClient({ baseUrl: homeserverUrl, idBaseUrl: identityUrl, -+ //:tchap: specify useAuthorization header to false to avoid this bug : -+ //https://github.com/tchapgouv/tchap-web-v4/issues/311 -+ //very strange this regression -+ //if we do not set it to false, a Authorization Bearer token undefined is sent to the server ++ // :TCHAP: specify useAuthorization header to false to avoid this bug : ++ // https://github.com/tchapgouv/tchap-web-v4/issues/311 ++ // if we do not set it to false, a Authorization Bearer token undefined is sent to the server, which refuses the invalid token. ++ // Regression introduced by element-web 1.11.12, solved by upgrading to 1.11.13. + useAuthorizationHeader: false ++ // end :TCHAP: }); this.clientSecret = this.client.generateClientSecret(); }