Fixed all firebase login issues. Added private routes. Reconfigured components and reorganized project.
This commit is contained in:
14
client/src/utils/private-route.js
Normal file
14
client/src/utils/private-route.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from "react";
|
||||
import { Route, Redirect } from "react-router-dom";
|
||||
export default ({ component: Component, isAuthorized, ...rest }) => (
|
||||
<Route
|
||||
{...rest}
|
||||
render={props =>
|
||||
isAuthorized === true ? (
|
||||
<Component {...props} />
|
||||
) : (
|
||||
<Redirect to="/signin" />
|
||||
)
|
||||
}
|
||||
/>
|
||||
);
|
||||
Reference in New Issue
Block a user