import React, { Component } from 'react';
import { connect } from 'react-redux';
import { replace } from 'react-router-redux';
import userManager from './userManager';

class SingleSignOnRedirectCallback extends Component {
  componentDidMount() {
    userManager.signinRedirectCallback() // TODO What if it fails?
        .then(() => {
          this.props.dispatch(replace(sessionStorage.lastUrlPath || ''));
        });
  }

  render() {
    return null;
  }
}

SingleSignOnRedirectCallback.propTypes = {
  dispatch: React.PropTypes.func.isRequired,
};

export default connect()(SingleSignOnRedirectCallback);

import { Component } from 'react';
import userManager from './userManager';

class SingleSignOnRedirectCallback extends Component {
  componentDidMount() {
    userManager.signinRedirectCallback();
  }

  render() {
    return null;
  }
}

export default SingleSignOnRedirectCallback;

Revert "Added the redirection back to the app after successful login"
Revert "Added the redirection back to the app after successful login"

This reverts commit c2ecd0c222d182a019fde099aaf2525b8cb9b251.
