This page describes how to remove auth for Next JS
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 AuthGuard wrapper for the routes within the DashboardLayout element:
In the code snippet above, the <AuthGuard> a component is commented out, allowing the routes within the DashboardLayoutcomponent 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 remove authentication from a system or application permanently, here are the steps to follow:
Remove below authentication keys below from next.config.jsfile.
Removed below list of files and directories.
Commented out the full file ./src/utils/axios.ts
Remove or change/loginroutes.
If you want to remove routes, remove the router component Link with href='' 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.
βββ src
β βββ app
β β βββ auth (remove directory with all sub files)
β β βββ api (remove directory with all sub files)
β βββ views
β β βββ authentication (remove directory with all sub files)
β β βββ auth (remove directory with all sub files)
β βββ sections
β β βββ auth (remove directory with all sub files)
β βββ utils
β β βββ route-guard (remove directory with all sub files)
β β βββ authOptions.ts