diff --git a/src/components/ServerConfigInput.jsx b/src/components/ServerConfigInput.jsx index 6fd53612107ed83481c9de61d2e369ee49b3b926..f412930bd1ea82dd4696bc69c3d0dca03625b7e9 100644 --- a/src/components/ServerConfigInput.jsx +++ b/src/components/ServerConfigInput.jsx @@ -9,18 +9,33 @@ class Component extends PureComponent { constructor(props) { super(props) - console.log("--- props", this.props) + // console.log("--- props", this.props) + + // With these Location object properties you can access all of these URL components + // + // hash - Sets or returns the anchor portion of a URL. + // host - Sets or returns the hostname and port of a URL. + // hostname - Sets or returns the hostname of a URL. + // href - Sets or returns the entire URL. + // pathname - Sets or returns the path name of a URL. + // port - Sets or returns the port number the server uses for a URL. + // protocol - Sets or returns the protocol of a URL. + // search - Sets or returns the query portion of a URL + + var currentURL = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '' ) + '/callback' + console.log("currentURL", currentURL) + this.state = { clientId: "6233aedf-f08a-4112-9a1b-f33c3cd9b396", - clientSecret: "af85a0f0-2c68-421d-8228-a6c83628de19", - redirectURL: "http://localhost:8080/callback" + clientSecret: "", + redirectURL: currentURL } } authenticateStart() { let config = Object.assign({}, this.props.serverConfig, this.state) - console.error("Authenticate", config, this.props.serverConfig, this.state) + // console.error("Authenticate", config, this.props.serverConfig, this.state) this.props.authenticateStart(config) } @@ -38,8 +53,8 @@ class Component extends PureComponent { render() { - console.log("X This props", this.props) - console.log("X This state", this.state) + // console.log("X This props", this.props) + // console.log("X This state", this.state) let authorizationEndpoint = '' if (this.state.authorizationEndpoint) {