12 lines
346 B
JavaScript
12 lines
346 B
JavaScript
import { withAuthenticationRequired } from "@auth0/auth0-react";
|
|
import React from "react";
|
|
import Loading from "../components/loading";
|
|
const ProtectedRoute = ({ component }) => {
|
|
const Component = withAuthenticationRequired(component, {
|
|
onRedirecting: () => <Loading />,
|
|
});
|
|
|
|
return <Component />;
|
|
};
|
|
export default ProtectedRoute;
|