diff --git a/src/components/HTTPFetchView.jsx b/src/components/HTTPFetchView.jsx index ddae04d500ec04bde2ecad876ef418727302bd68..50648b351c48d615eb1ef070ac4bd3ea8fcadbb1 100644 --- a/src/components/HTTPFetchView.jsx +++ b/src/components/HTTPFetchView.jsx @@ -35,25 +35,25 @@ class Component extends PureComponent { fetchUserinfo() { let endpoint = this.props.serverConfig.userinfo_endpoint; - console.error("Get userinfo from ", endpoint) + // console.error("Get userinfo from ", endpoint) this.props.httpRequestStart(endpoint) } fetchCustom() { let endpoint = this.state.customEndpoint - console.error("Get data from ", endpoint) + // console.error("Get data from ", endpoint) this.props.httpRequestStart(endpoint) } preselect(key, event) { - console.log("Key", key, "event", event) + // console.log("Key", key, "event", event) this.setState({customEndpoint: key}) } renderDropdownButton() { const i = "drpdwn" const title = "Load preset URL" - console.log("PROPOS", this.props) + // console.log("PROPOS", this.props) if (this.props.serverConfig && this.props.serverConfig.authorization_endpoint && this.props.serverConfig.authorization_endpoint === 'https://auth.dataporten.no/oauth/authorization') { let links = [] if (this.props.serverConfig.userinfo_endpoint) { @@ -76,7 +76,7 @@ class Component extends PureComponent { url: "https://" + res[1] + ".dataporten-api.no/", title: "Dataporten APIGK " + res[1] }) - console.log(res) + // console.log(res) } }) let menuitems = links.map((link) => { @@ -95,7 +95,7 @@ class Component extends PureComponent { } render() { - console.error("Component", this.props) + // console.error("Component", this.props) if (!this.props.token) { return null diff --git a/src/components/HTTPResponseView.jsx b/src/components/HTTPResponseView.jsx index 77f081c56a0297e3bf46ddedbfbdff5580a9ea88..07237b3f8341ea30443520d127c52e0d5f3175b4 100644 --- a/src/components/HTTPResponseView.jsx +++ b/src/components/HTTPResponseView.jsx @@ -31,7 +31,7 @@ class Component extends PureComponent { fetchUserinfo() { let endpoint = this.props.serverConfig.userinfo_endpoint; - console.error("Get userinfo from ", endpoint) + // console.error("Get userinfo from ", endpoint) this.props.httpRequestStart(endpoint) } @@ -55,7 +55,7 @@ class Component extends PureComponent { return null } render() { - console.error("Component", this.props) + // console.error("Component", this.props) if (!this.props.http) { return ( diff --git a/src/components/HostnameInput.jsx b/src/components/HostnameInput.jsx index b6dab14ab31bb4d524cd7816771a725903393d6e..b757014f90a914b044e60e311bbe520f548d1ff3 100644 --- a/src/components/HostnameInput.jsx +++ b/src/components/HostnameInput.jsx @@ -16,25 +16,25 @@ class Component extends PureComponent { } discoveryStart(e) { - console.log("Setting hostname", this.state.hostname) - console.log(this.props) + // console.log("Setting hostname", this.state.hostname) + // console.log(this.props) this.props.discoveryStart(this.state.hostname) } updateHostfield(e) { - console.log("Updating hostname to ", e.target.value) + // console.log("Updating hostname to ", e.target.value) this.setState({hostname: e.target.value}) } handleAlertDismiss() { - console.error("TODO: Dismiss alert.") + // console.error("TODO: Dismiss alert.") // this.setState({hostname: e.target.value}) } getErrorMessage() { if (this.props.serverError) { - console.log(typeof this.props.serverError) - console.error(this.props.serverError) + // console.log(typeof this.props.serverError) + // console.error(this.props.serverError) return (

Error performing OAuth Discovery

diff --git a/src/components/ServerConfigInput.jsx b/src/components/ServerConfigInput.jsx index a5f4130f59b5359b9384b1a626cc032a72a9f295..896ceab2c3025d48bb76db27b1f46889b9c9ba4f 100644 --- a/src/components/ServerConfigInput.jsx +++ b/src/components/ServerConfigInput.jsx @@ -23,7 +23,7 @@ class Component extends PureComponent { // 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) + // console.log("currentURL", currentURL) this.state = { clientId: "6233aedf-f08a-4112-9a1b-f33c3cd9b396", diff --git a/src/components/TokenView.jsx b/src/components/TokenView.jsx index 6974058b6fb5294ceb11493fa15df63262cc247f..bf267bc9d1f0bd62afe05a8a2d255cd462aa150f 100644 --- a/src/components/TokenView.jsx +++ b/src/components/TokenView.jsx @@ -32,7 +32,7 @@ class Component extends PureComponent { } render() { - console.error("Component", this.props) + // console.error("Component", this.props) if (!this.props.token) { return ( diff --git a/src/utils/API.js b/src/utils/API.js index 6698588684b317c537c4628c35a91213db09e3b8..193180bda7fad2db436cfdc783f552185b63d007 100644 --- a/src/utils/API.js +++ b/src/utils/API.js @@ -16,7 +16,7 @@ const API = { // config.headers["original-token"] = token.access_token config.method = "GET" config.mode = "cors" - console.log("About to fetch", config) + // console.log("About to fetch", config) return fetch(url, config).then((response) => { if (response.ok) { @@ -25,11 +25,11 @@ const API = { throw Error(response.statusText) }) .then((data) => { - console.log("DATA", data) + // console.log("DATA", data) dispatch(actions.discovery.completed(data)) }) .catch((err) => { - console.error("ERROR Fetching API Discovery", err) + // console.error("ERROR Fetching API Discovery", err) dispatch(actions.discovery.completed(err)) }) } @@ -46,7 +46,7 @@ const API = { config.headers.Authorization = 'Bearer ' + state.token.access_token config.method = "GET" config.mode = "cors" - console.log("About to fetch", config) + // console.log("About to fetch", config) let resp = null @@ -70,7 +70,7 @@ const API = { dispatch(actions.http.completed(r)) }) .catch((err) => { - console.error("ERROR Fetching API Discovery", err) + // console.error("ERROR Fetching API Discovery", err) dispatch(actions.http.completed(err)) }) } @@ -78,10 +78,10 @@ const API = { "authenticate": function(config) { return dispatch => { - console.error("About to save config", JSON.stringify(config, undefined, 3)) + // console.error("About to save config", JSON.stringify(config, undefined, 3)) dispatch(actions.serverConfig.save(config)) - console.error("About to authentication", JSON.stringify(config, undefined, 3)) + // console.error("About to authentication", JSON.stringify(config, undefined, 3)) const jsoconfig = { providerID: "oauthPlay", client_id: config.clientId, @@ -91,7 +91,7 @@ const API = { } setTimeout(() => { - console.error("JSOCONFIG", JSON.stringify(jsoconfig, undefined, 2)) + // console.error("JSOCONFIG", JSON.stringify(jsoconfig, undefined, 2)) let opts = {} if (config.response_type) { @@ -105,7 +105,7 @@ const API = { appJSO = new jso(jsoconfig) appJSO.getToken((token) => { - console.error("Got token, ayay", token) + // console.error("Got token, ayay", token) dispatch(actions.tokens.save(token)) }, opts) }, 1000) @@ -123,7 +123,7 @@ const API = { authorization: state.serverConfig.authorization_endpoint // scopes: { request: ["userinfo"]} } - console.error("About to logout with ", jsoconfig) + // console.error("About to logout with ", jsoconfig) appJSO = new jso(jsoconfig) appJSO.wipeTokens() dispatch(actions.tokens.save(null)) @@ -135,10 +135,10 @@ const API = { var state = getState() if (!state || !state.serverConfig || !state.serverConfig.clientId) { - console.error("CANNOT DO CALLBACK BECAUSE CLIENDIT is missing...", state) + // console.error("CANNOT DO CALLBACK BECAUSE CLIENDIT is missing...", state) return } - console.error(". STATE STATE STATE ", state) + // console.error(". STATE STATE STATE ", state) const jsoconfig = { providerID: "oauthPlay", client_id: state.serverConfig.clientId, @@ -146,10 +146,10 @@ const API = { authorization: state.serverConfig.authorization_endpoint // scopes: { request: ["userinfo"]} } - console.error(". Initialising oauth callback", jsoconfig) + // console.error(". Initialising oauth callback", jsoconfig) appJSO = new jso(jsoconfig) appJSO.callback(undefined, (token) => { - console.error(" ====) (===== Got token, ayay", token) + // console.error(" ====) (===== Got token, ayay", token) dispatch(actions.tokens.save(token)) }) } diff --git a/src/utils/index.js b/src/utils/index.js index 4122130cc0a976044dd97587c89bbba0d3f3b509..eb28b34427e61687627ffa6130b613ce32a11ae0 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -71,7 +71,7 @@ export function processValues(defaults, uservalues) { let item = { type: null } - console.log("Processing key", key) + // console.log("Processing key", key) if (defaults && defaults.hasOwnProperty(key)) { item.type = getType(defaults[key]) } else if (uservalues && uservalues.hasOwnProperty(key)) {