NextJS
This page describes how to remove auth for NextJS
Mantis uses next-auth for authentication system.
Remove Authentication Permanent
If you want to permanently remove authentication for nextJS, here are the steps to follow:
Remove below authentication keys from
.envfile.
...
...
## Next Auth
NEXTAUTH_URL=
## NEXTAUTH_URL=
NEXTAUTH_SECRET_KEY=
## Auth0
REACT_APP_AUTH0_CLIENT_ID=
REACT_APP_AUTH0_CLIENT_SECRET=
REACT_APP_AUTH0_DOMAIN=
## Cognito
REACT_APP_COGNITO_CLIENT_ID=
REACT_APP_COGNITO_CLIENT_SECRET=
REACT_APP_COGNITO_REGION=
REACT_APP_COGNITO_POOL_ID=
REACT_APP_COGNITO_DOMAIN=
## JWT
## for 1 day - 86400 = 1* 24 * 60 * 60
REACT_APP_JWT_TIMEOUT=
REACT_APP_JWT_SECRET=
...
...Remove below authentication keys from
next.config.jsfile.
Remove below list of files and directory.
Remove following lines from file
src\app\ProviderWrapper.tsx
Remove following lines from file
src\app(dashboard)\layout.tsx
Remove and change following lines from file
src\hooks\useUser.ts
Remove following lines from file - src\layout\DashboardLayout\Drawer\DrawerContent\NavUser.tsx
Remove following lines from file
src\layout\DashboardLayout\Header\HeaderContent\Profile\index.tsx
remove props handleLogout from file
src\layout\DashboardLayout\Header\HeaderContent\Profile\ProfileTab.tsx
Remove following lines from file
src\menu-items\pages.tsx
Remove following lines from file
src\utils\axios.ts
Remove package
"next-auth": "^**.**.**"from filepackage.json, removemode_modulesand install node again.
Disabling authentication within the system would render certain applications non-functional, particularly those reliant on backend APIs. These applications require a valid token to access and load data seamlessly.
Last updated