NextJS

This page describes how to remove auth for NextJS

Mantis uses the next-auth for the authentication system.

Remove Authentication Permanent

If you want to permanently remove authentication for nextJS, here are the steps to follow:

  1. Remove below authentication keys from .env file.

.env
...
...
## Next Auth
NEXT_PUBLIC_AUTH_URL=
## NEXT_PUBLIC_AUTH_URL=
NEXT_PUBLIC_NEXTAUTH_SECRET=

## 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=
...
...
  1. Remove the below list of files and directories.

  1. Remove the following lines from a file src\app\ProviderWrapper.tsx

  1. Remove the following lines from a filesrc\app(dashboard)\layout.tsx

  1. Remove the following lines from a file: src/layout/DashboardLayout/index.tsx

  1. Remove and change the following lines from a file src\hooks\useUser.ts

  1. Remove the following lines from the file - src\layout\DashboardLayout\Drawer\DrawerContent\NavUser.tsx

  1. Remove the following lines from the file src\layout\DashboardLayout\Header\HeaderContent\Profile\index.tsx

  1. remove props handleLogout from file src\layout\DashboardLayout\Header\HeaderContent\Profile\ProfileTab.tsx

  1. Remove the following lines from a file src\menu-items\pages.tsx

  1. Remove the following lines from a file src\utils\axios.ts

  1. Remove package "next-auth": "^**.**.**" from file package.json, remove mode_modules and install node again.