- The authContext maintains the auth
- The PrivateWrapper can be used for views that are only accessible when the user is authenticated
- The authContext has a jwt verifier that checks if the jwt is expired or not. I have made the jwt expired before 5 minutes of the actual expiry time.
- The signin is functional, change the ui according to the need of the project
const id = this.props.match.params.id;
// in the redirecting component
<Redirect
to={{
pathname: "/login",
state: { from: location },
}}
/>;
// in the other component you redirected to
const { location } = props.location.state;
<div className={classes.gridroot}>
<Grid container spacing={3}>
<Grid item xs={4} sm={4} md={2} lg={2} xl={2}>
{/*the div will be having spaces between them*/}
<div style={{width: '100%', background: 'red'}}></div>
}
</Grid>
</Grid>
</div>
gridroot: {
flexGrow: 1,
},