Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 1.22 KB

README.md

File metadata and controls

32 lines (27 loc) · 1.22 KB

Work Experience Template (Client App)

Overview

The client app is a very lean VITE React SPA with minimal boilerplate:

  • src/
    • assets/
      • CSS, Images, Fonts, etc.
    • components/
      • React components (non-pages).
    • providers/
      • React provider components.
    • routes/
    • hooks.js
      • Reusable custom hooks.
    • contexts.js
      • React context object definitions
    • socket.js
      • Socket.io configuration
  • .env
    • Environment Variable file for storing Auth0 credentials, cloud credentials as well as any other environment-specific values.
  • vite.config.js

Authenticated Routes

To make a page require authentication from the user, simply wrap the component in the withAuthenticationRequired HOC. This should only need to be used on page-level components in /routes that get rendered from RouteProvider.jsx. For example:

import { withAuthenticationRequired } from "@auth0/auth0-react";

export const ProtectedPage = withAuthenticationRequired(() => <div>Protected Page</div>)