import React, { PureComponent } from 'react' import {Alert, Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap' import {Panel, Row, Col, Collapse, FormControl, FormGroup, ControlLabel, HelpBlock} from 'react-bootstrap' import FontAwesome from 'react-fontawesome' const defaultHost = "https://auth.dataporten.no" class Component extends PureComponent { constructor(props) { super(props) this.state = { hostname: defaultHost } } discoveryStart(e) { 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) this.setState({hostname: e.target.value}) } handleAlertDismiss() { 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) return (

Error performing OAuth Discovery

{this.props.serverError.toString()}

or

) } return null } render() { console.log("This state", this.props) let errorMessage = null if (this.props.serverError) { errorMessage = (

Error performing OAuth Discovery

{this.props.serverError}

) } return (

OAuth Server hostname

Fill out the hostname of your OAuth server. Will only work if your OAuth server support OpenID Connect Discovery. If not, please enter configuration manually.
{this.getErrorMessage()}
) } } export default Component