From 826efeaeaa54ac6f5cbb1f3f3eb66790b8b065dd Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 1 Jun 2021 10:22:24 +0100 Subject: [PATCH 1/2] Update way of checking for registration disabled Spec says 403 + M_FORBIDDEN --- src/components/structures/auth/Registration.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index 96fb9bdc82..fce7450b8b 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -223,7 +223,7 @@ export default class Registration extends React.Component { this.setState({ flows: e.data.flows, }); - } else if (e.httpStatus === 403 && e.errcode === "M_UNKNOWN") { + } else if (e.httpStatus === 403 || e.errcode === "M_FORBIDDEN") { // At this point registration is pretty much disabled, but before we do that let's // quickly check to see if the server supports SSO instead. If it does, we'll send // the user off to the login page to figure their account out. From 4e6f1e62946b6b048e31e3d1279e04afa0ac753d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 1 Jun 2021 15:00:59 +0100 Subject: [PATCH 2/2] add comment --- src/components/structures/auth/Registration.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index fce7450b8b..f9361647d7 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -224,6 +224,7 @@ export default class Registration extends React.Component { flows: e.data.flows, }); } else if (e.httpStatus === 403 || e.errcode === "M_FORBIDDEN") { + // Check for 403 or M_FORBIDDEN, Synapse used to send 403 M_UNKNOWN but now sends 403 M_FORBIDDEN. // At this point registration is pretty much disabled, but before we do that let's // quickly check to see if the server supports SSO instead. If it does, we'll send // the user off to the login page to figure their account out.