Commit 493648c9 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Less logging

parent d26bb495
......@@ -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
......
......@@ -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 (
......
......@@ -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 (
<Alert bsStyle="danger" onDismiss={this.handleAlertDismiss}>
<h4>Error performing OAuth Discovery</h4>
......
......@@ -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",
......
......@@ -32,7 +32,7 @@ class Component extends PureComponent {
}
render() {
console.error("Component", this.props)
// console.error("Component", this.props)
if (!this.props.token) {
return (
......
......@@ -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))
})
}
......
......@@ -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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment