From e3d1cf8d84d57e438755fc264dd742b00e77f979 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sun, 5 Apr 2020 20:55:26 +0200 Subject: [PATCH 1/5] Replace {} with null to be compliant with newer specs. While older also accepted null for the auth part of the registration request object Took 18 minutes --- src/components/structures/auth/Registration.js | 2 +- src/components/views/auth/InteractiveAuthEntryComponents.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index c74f6ed6e3..dc22516cd8 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -243,7 +243,7 @@ export default createReactClass({ }); }; try { - await this._makeRegisterRequest({}); + await this._makeRegisterRequest(null); // This should never succeed since we specified an empty // auth object. console.log("Expecting 401 from register request but got success!"); diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index 327451be17..bee99306a3 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -650,7 +650,7 @@ export class SSOAuthEntry extends React.Component { }; onConfirmClick = () => { - this.props.submitAuthDict({}); + this.props.submitAuthDict(null); }; render() { @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict({}); + this.props.submitAuthDict(null); } }, From 9820400680003564b8538502b98227836c0ea723 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 8 Apr 2020 20:53:05 +0200 Subject: [PATCH 2/5] Update src/components/structures/auth/Registration.js Co-Authored-By: Travis Ralston --- src/components/structures/auth/Registration.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index dc22516cd8..a84d779371 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -244,8 +244,7 @@ export default createReactClass({ }; try { await this._makeRegisterRequest(null); - // This should never succeed since we specified an empty - // auth object. + // This should never succeed since we're doing UIA console.log("Expecting 401 from register request but got success!"); } catch (e) { if (e.httpStatus === 401) { From 69c1e117a3310e66d88023b16a7dcc7249f01b2d Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 8 Apr 2020 20:55:02 +0200 Subject: [PATCH 3/5] Fix submitAuthDict(null) being null in places where it actually should be auth: {} Took 16 minutes --- src/components/views/auth/InteractiveAuthEntryComponents.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index bee99306a3..327451be17 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -650,7 +650,7 @@ export class SSOAuthEntry extends React.Component { }; onConfirmClick = () => { - this.props.submitAuthDict(null); + this.props.submitAuthDict({}); }; render() { @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict(null); + this.props.submitAuthDict({}); } }, From 0e42a6ff851ae2fadbfe1ecc0d24991516d3aa74 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 10 Apr 2020 19:16:15 +0200 Subject: [PATCH 4/5] Send empty auth key value pair if doing FallbackStage Took 3 minutes --- src/components/views/auth/InteractiveAuthEntryComponents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index 327451be17..4222aa9255 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict({}); + this.props.submitAuthDict(null); } }, From 9e2d80b8c8382951424181bade0fb23446a80e77 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 27 May 2020 13:16:49 -0600 Subject: [PATCH 5/5] Update documentation and auth dict submissions --- src/components/structures/auth/Registration.js | 3 +-- src/components/views/auth/InteractiveAuthEntryComponents.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index e8938da5c1..6349614d72 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -248,8 +248,7 @@ export default createReactClass({ // need to. if (!this.state.doingUIAuth) { await this._makeRegisterRequest(null); - // This should never succeed since we specified an empty - // auth object. + // This should never succeed since we specified no auth object. console.log("Expecting 401 from register request but got success!"); } } catch (e) { diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js index e404f15d28..655452fcee 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -740,7 +740,7 @@ export const FallbackAuthEntry = createReactClass({ event.data === "authDone" && event.origin === this.props.matrixClient.getHomeserverUrl() ) { - this.props.submitAuthDict(null); + this.props.submitAuthDict({}); } },