ohif-viewer/src/CallbackPage.js

33 lines
832 B
JavaScript
Raw Normal View History

import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
2019-01-08 10:48:57 +01:00
import PropTypes from 'prop-types';
import { CallbackComponent } from 'redux-oidc';
2019-01-07 19:17:10 +01:00
2019-01-08 10:48:57 +01:00
class CallbackPage extends Component {
static propTypes = {
userManager: PropTypes.object.isRequired,
2019-05-29 14:39:54 +02:00
history: PropTypes.object.isRequired,
};
2019-01-08 10:48:57 +01:00
render() {
return (
<CallbackComponent
userManager={this.props.userManager}
successCallback={() => {
const pathname = sessionStorage.getItem('ohif-redirect-to');
this.props.history.push(pathname);
}}
errorCallback={error => {
//this.props.history.push("/");
throw new Error(error);
}}
>
<div>Redirecting...</div>
</CallbackComponent>
);
}
2019-01-07 19:17:10 +01:00
}
export default withRouter(CallbackPage);