Rev 7375 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react'
import { Route, useHistory } from 'react-router-dom'
const AuthRoute = ({ children, isAuthenticated, ...rest }) => {
const history = useHistory()
if (isAuthenticated) {
history.push('/dashboard')
return null
}
return <Route {...rest}>{children}</Route>
}
export default AuthRoute