mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
Login frontend complete
This commit is contained in:
11
twistter-frontend/src/util/AuthRoute.js
Normal file
11
twistter-frontend/src/util/AuthRoute.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react'
|
||||
import { Route, Redirect} from 'react-router-dom';
|
||||
|
||||
const AuthRoute = ({ component: Component, authenticated, ...rest}) => (
|
||||
<Route
|
||||
{...rest}
|
||||
render = {(props) => authenticated === true ? <Redirect to='/home'/> : <Component {...props} />}
|
||||
/>
|
||||
)
|
||||
|
||||
export default AuthRoute;
|
||||
Reference in New Issue
Block a user