Conform more of the codebase to strict types (#11191)

This commit is contained in:
Michael Telatynski 2023-07-05 11:53:22 +01:00 committed by GitHub
parent 4044c2aa66
commit 8107f1d271
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 88 additions and 57 deletions

View file

@ -246,11 +246,11 @@ export default class Registration extends React.Component<IProps, IState> {
}
} catch (e) {
if (serverConfig !== this.latestServerConfig) return; // discard, serverConfig changed from under us
if (e.httpStatus === 401) {
if (e instanceof MatrixError && e.httpStatus === 401) {
this.setState({
flows: e.data.flows,
});
} else if (e.httpStatus === 403 || e.errcode === "M_FORBIDDEN") {
} else if (e instanceof MatrixError && (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