// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import {emitUserLoggedOutEvent} from 'actions/global_actions.jsx'; import React from 'react'; import {FormattedMessage} from 'react-intl'; import {browserHistory, Link} from 'react-router/es6'; import logoImage from 'images/logo.png'; export default class MFAController extends React.Component { componentDidMount() { if (window.mm_license.MFA !== 'true' || window.mm_config.EnableMultifactorAuthentication !== 'true') { browserHistory.push('/'); } } render() { let backButton; if (window.mm_config.EnforceMultifactorAuthentication === 'true') { backButton = (
{ e.preventDefault(); emitUserLoggedOutEvent('/login'); }} >
); } else { backButton = (
); } return (
{backButton}

{React.cloneElement(this.props.children, {})}
); } } MFAController.defaultProps = { }; MFAController.propTypes = { location: React.PropTypes.object.isRequired, children: React.PropTypes.node };