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:
Comment out the
AuthGuardwrapper for the routes within theMainLayoutelement:
// 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:
Remove the below authentication keys from
.envthe file.
Removed below list of files and directories.
Remove
AuthGuard- Open file src/layouts/MainLayout/index.tsx, and removeAuthGuard
Remove
AuthRoutes- Open file ./src/routes/index.tsx, and removeAuthRoutesimport.
Remove
AuthProvider- Open file src/App.tsx, and remove AuthProvider import.
Remove Auth pages routes from
PageRoutes- Open file ./src/routes/PageRoutes.tsx and remove Auth pages import.
Remove logout - Open file src/layouts/MainLayout/Header/Profile.tsx and remove logout import.
Remove Auth pages from menu items - Open file src/menu-items/pages.ts remove below code
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:
Comment out the
AuthGuardwrapper for the routes within theMainLayoutelement:
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:
Remove below authentication keys from
.envfile.
Removed below list of files and directory.
Remove
AuthGuard- Open file src/layouts/MainLayout/index.jsx, and removeAuthGuard
Remove
AuthRoutes- Open file ./src/routes/index.jsx, and removeAuthRoutesimport.
Remove
AuthProvider- Open file src/App.jsx, and remove AuthProvider import.
Remove Auth pages routes from
PageRoutes- Open file ./src/routes/PageRoutes.jsx and remove Auth pages import.
Remove logout - Open file src/layouts/MainLayout/Header/Profile.jsx and remove logout import.
Remove Auth pages from menu items - Open file src/menu-items/pages.js remove below code
Last updated
Was this helpful?