// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. var Client = require('../utils/client.jsx'); export default class Authorize extends React.Component { constructor(props) { super(props); this.handleAllow = this.handleAllow.bind(this); this.handleDeny = this.handleDeny.bind(this); this.state = {}; } handleAllow() { const responseType = this.props.responseType; const clientId = this.props.clientId; const redirectUri = this.props.redirectUri; const state = this.props.state; const scope = this.props.scope; Client.allowOAuth2(responseType, clientId, redirectUri, state, scope, (data) => { if (data.redirect) { window.location.replace(data.redirect); } }, () => {} ); } handleDeny() { window.location.replace(this.props.redirectUri + '?error=access_denied'); } render() { return (