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:

  1. Remove below authentication keys from .env file.

.env
...
...
## 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=
...
...
  1. Remove below authentication keys from next.config.js file.

  1. Remove below list of files and directory.

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

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

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

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

  1. Remove following lines from 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 following lines from file src\menu-items\pages.tsx

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

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

Last updated