Remove Authentication

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 MainLayout element:

src/layouts/MainLayout/index.tsx
// import AuthGuard from 'utils/route-guard/AuthGuard';

...
...
return (
    // <AuthGuard>
      <Stack direction="row" width={1}>
        <Header />
        ...
      </Stack>
    // </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 the below authentication keys from .env the file.

  1. Removed below list of files and directories.

  1. Remove AuthGuard - Open file src/layouts/MainLayout/index.tsx, and remove AuthGuard

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

  1. Remove AuthProvider - Open file src/App.tsx, and remove AuthProvider import.

  1. Remove Auth pages routes from PageRoutes - Open file ./src/routes/PageRoutes.tsx and remove Auth pages import.

  1. Remove logout - Open file src/layouts/MainLayout/Header/Profile.tsx and remove logout import.

  1. Remove Auth pages from menu items - Open file src/menu-items/pages.ts remove below code

Last updated

Was this helpful?