How to use the matrix-js-sdk.AutoDiscovery.SUCCESS function in matrix-js-sdk

To help you get started, we’ve selected a few matrix-js-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FabricLabs / fabric / src / components / structures / auth / Login.js View on Github external
_tryWellKnownDiscovery: async function(serverName) {
        if (!serverName.trim()) {
            // Nothing to discover
            this.setState({
                discoveryError: "",
                findingHomeserver: false,
            });
            return;
        }

        this.setState({findingHomeserver: true});
        try {
            const discovery = await AutoDiscovery.findClientConfig(serverName);

            const state = discovery["m.homeserver"].state;
            if (state !== AutoDiscovery.SUCCESS && state !== AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: discovery["m.homeserver"].error,
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.SUCCESS) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
                this.onServerConfigChange({
                    hsUrl: discovery["m.homeserver"].base_url,
github FabricLabs / fabric / src / components / structures / auth / Login.js View on Github external
_tryWellKnownDiscovery: async function(serverName) {
        if (!serverName.trim()) {
            // Nothing to discover
            this.setState({
                discoveryError: "",
                findingHomeserver: false,
            });
            return;
        }

        this.setState({findingHomeserver: true});
        try {
            const discovery = await AutoDiscovery.findClientConfig(serverName);

            const state = discovery["m.homeserver"].state;
            if (state !== AutoDiscovery.SUCCESS && state !== AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: discovery["m.homeserver"].error,
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.SUCCESS) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
                this.onServerConfigChange({
                    hsUrl: discovery["m.homeserver"].base_url,
github FabricLabs / fabric / src / components / structures / auth / Login.js View on Github external
this.setState({findingHomeserver: true});
        try {
            const discovery = await AutoDiscovery.findClientConfig(serverName);

            const state = discovery["m.homeserver"].state;
            if (state !== AutoDiscovery.SUCCESS && state !== AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: discovery["m.homeserver"].error,
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.SUCCESS) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
                this.onServerConfigChange({
                    hsUrl: discovery["m.homeserver"].base_url,
                    isUrl: discovery["m.identity_server"].state === AutoDiscovery.SUCCESS
                        ? discovery["m.identity_server"].base_url
                        : "",
                });
            } else {
                console.warn("Unknown state for m.homeserver in discovery response: ", discovery);
                this.setState({
                    discoveryError: _t("Unknown failure discovering homeserver"),
                    findingHomeserver: false,
                });
github FabricLabs / fabric / src / components / structures / auth / Login.js View on Github external
this.setState({findingHomeserver: true});
        try {
            const discovery = await AutoDiscovery.findClientConfig(serverName);

            const state = discovery["m.homeserver"].state;
            if (state !== AutoDiscovery.SUCCESS && state !== AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: discovery["m.homeserver"].error,
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.PROMPT) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
            } else if (state === AutoDiscovery.SUCCESS) {
                this.setState({
                    discoveryError: "",
                    findingHomeserver: false,
                });
                this.onServerConfigChange({
                    hsUrl: discovery["m.homeserver"].base_url,
                    isUrl: discovery["m.identity_server"].state === AutoDiscovery.SUCCESS
                        ? discovery["m.identity_server"].base_url
                        : "",
                });
            } else {
                console.warn("Unknown state for m.homeserver in discovery response: ", discovery);
                this.setState({
                    discoveryError: _t("Unknown failure discovering homeserver"),
                    findingHomeserver: false,
                });