text: import React from 'react';
  import { withRouter } from 'react-router'
  import { Route, Redirect } from 'react-router-dom';
  
  class Authority extends React.Component {
      render() {
          const {
              component: Component,
              ...rest
          } = this.props;
  
          const isLogged = sessionStorage.getItem('token') ? true : false;
  
          return (
              <Route {...rest} render={props => {
                  return isLogged
                      ?  <Component {...props} />
                      : <Redirect to='/login' />
              }} />
          )
      }
  }
  
  export default withRouter(Authority);