Merge pull request #5496 from matrix-org/t3chguy/msc2858

Better adhere to MSC process
pull/21833/head
Michael Telatynski 2020-12-16 10:58:56 +00:00 committed by GitHub
commit 3940eab165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 7 deletions

View File

@ -41,8 +41,6 @@ export interface IIdentityProvider {
export interface ISSOFlow {
type: "m.login.sso" | "m.login.cas";
// eslint-disable-next-line camelcase
identity_providers: IIdentityProvider[];
"org.matrix.msc2858.identity_providers": IIdentityProvider[]; // Unstable prefix for MSC2858
}

View File

@ -462,8 +462,7 @@ export default class Registration extends React.Component<IProps, IState> {
let ssoSection;
if (this.state.ssoFlow) {
let continueWithSection;
const providers = this.state.ssoFlow["org.matrix.msc2858.identity_providers"]
|| this.state.ssoFlow["identity_providers"] || [];
const providers = this.state.ssoFlow["org.matrix.msc2858.identity_providers"] || [];
// when there is only a single (or 0) providers we show a wide button with `Continue with X` text
if (providers.length > 1) {
// i18n: ssoButtons is a placeholder to help translators understand context

View File

@ -79,7 +79,7 @@ interface IProps {
}
const SSOButtons: React.FC<IProps> = ({matrixClient, flow, loginType, fragmentAfterLogin, primary}) => {
const providers = flow.identity_providers || flow["org.matrix.msc2858.identity_providers"] || [];
const providers = flow["org.matrix.msc2858.identity_providers"] || [];
if (providers.length < 2) {
return <div className="mx_SSOButtons">
<SSOButton

View File

@ -132,8 +132,8 @@ describe('Login', function() {
// Set non-empty flows & matrixClient to get past the loading spinner
root.setState({
flows: [{
type: "m.login.sso",
identity_providers: [{
"type": "m.login.sso",
"org.matrix.msc2858.identity_providers": [{
id: "a",
name: "Provider 1",
}, {