diff --git a/src/components/ServerConfigInput.jsx b/src/components/ServerConfigInput.jsx index e57ccc240c1c48d1dfbcd6d7bdc9a1b13d162e26..e4702e0c1b7a89622062673638977ab33510c4c7 100644 --- a/src/components/ServerConfigInput.jsx +++ b/src/components/ServerConfigInput.jsx @@ -26,11 +26,11 @@ class Component extends PureComponent { // console.log("currentURL", currentURL) this.state = { - clientId: "6233aedf-f08a-4112-9a1b-f33c3cd9b396", - clientSecret: "", + // clientId: "6233aedf-f08a-4112-9a1b-f33c3cd9b396", + // clientSecret: "", redirectURL: currentURL, - scopes: "", - response_type: "token" + // scopes: "", + // response_type: "token" } } @@ -47,9 +47,11 @@ class Component extends PureComponent { updateFieldHandler(field) { return (e) => { - this.setState({ + const upd = { [field]: e.target.value - }) + } + this.props.updateConfig(upd) + // this.setState(upd) } } @@ -59,26 +61,32 @@ class Component extends PureComponent { // console.log("X This state", this.state) let authorizationEndpoint = '' - if (this.state.authorizationEndpoint) { - authorizationEndpoint = this.state.authorizationEndpoint - } else if (this.props.serverConfig) { + if (this.props.serverConfig) { authorizationEndpoint = this.props.serverConfig.authorization_endpoint } let tokenEndpoint = '' - if (this.state.tokenEndpoint) { - tokenEndpoint = this.state.tokenEndpoint - } else if (this.props.serverConfig) { + if (this.props.serverConfig) { tokenEndpoint = this.props.serverConfig.token_endpoint } let userinfoEndpoint = '' - if (this.state.userinfoEndpoint) { - userinfoEndpoint = this.state.userinfoEndpoint - } else if (this.props.serverConfig) { + if (this.props.serverConfig) { userinfoEndpoint = this.props.serverConfig.userinfo_endpoint } + let clientId = '' + if (this.props.serverConfig) { + clientId = this.props.serverConfig.client_id + } + + let clientSecret = '' + + let scopes = '' + if (this.props.serverConfig) { + scopes = this.props.serverConfig.scopes + } + let expanded = this.props.expanded && !!this.props.serverConfig return ( @@ -86,12 +94,12 @@ class Component extends PureComponent {