PHP Classes

File: resources/js/components/AuthenticatedRoutes.js

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   Laravel React Task Management   resources/js/components/AuthenticatedRoutes.js   Download  
File: resources/js/components/AuthenticatedRoutes.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel React Task Management
Application to manage tasks
Author: By
Last change:
Date: 1 year ago
Size: 578 bytes
 

Contents

Class file image Download
import React from "react"; import { Route, Redirect } from "react-router-dom"; import { PUBLIC_URL } from "../constants"; function AuthenticatedRoutes({ component: Component, authed, ...rest }) { return ( <Route {...rest} render={(props) => authed === true ? ( <Component {...props} exact={true} /> ) : ( <Redirect to={{ pathname: `${PUBLIC_URL}login`, state: { from: props.location }, }} /> ) } /> ); } export default AuthenticatedRoutes;