For the complete documentation index, see llms.txt. This page is also available as Markdown.

Vite

This page describes how to remove auth for VITE

Disable Authentication Temporary

Disabling authentication temporarily is generally not recommended due to security risks. However, if you have a specific scenario where you need to disable authentication for a short period, here are some steps you can follow:

  1. Comment out the AuthGuard wrapper for the routes within the DashboardLayout element:

src/layout/Dashboard/index.jsx
// import AuthGuard from 'utils/route-guard/AuthGuard';

...
...
return (
  // <AuthGuard>
 <Box sx={{ display: 'flex', width: '100%' }}>
    <Header />
    ...
  </Box>
  // </AuthGuard>
)

In the code snippet above, the <AuthGuard> a component is commented out, allowing the routes within the MainLayout component to be rendered without authentication protection. To enable the AuthGuard wrapper again, remove the comment markers (//) surrounding the <AuthGuard> component.

Remove Authentication Permanent

If you want to permanently remove authentication from a system or application, here are the steps to follow:

  1. Remove below authentication keys from .env file.

  1. Removed below list of files and directory.

  1. Remove LoginRoutes - Open file ./src/routes/index.tsx, and remove LoginRoutes import.

  1. Remove or change /login routes.

    • If you want to remove routes - remove router component RouterLink or Link with to='' props.

    • If you want to change url - set the home page URL like, to={APP_DEFAULT_PATH} , And import APP_DEFAULT_PATH from config file.

  2. Remove useAuth hook - Remove the below imports from throughout the project and set static values for user profile props.

  1. Remove axios interceptors response from ./src/utils/axios.ts file

Last updated