Datta
Datta Able - React
Datta Able - React
  • Documentation
  • Pre-requisites
  • Quick Start
  • Folder Structure
  • State Management
  • Authentication
    • Switch to Auth0
    • Switch to Firebase
  • Axios API Calls
  • Routing
  • Project Configuration
  • Theme Layouts
  • Theme/Style Configuration
  • Integration
    • Seed
    • Comparison
  • Dependencies
  • Support
  • Changelog
Powered by GitBook
On this page
  1. Authentication

Switch to Auth0

PreviousAuthenticationNextSwitch to Firebase

Last updated 11 months ago

JWT to Auth0

Set Auth0 Config

At present, Auth0 uses a dummy client id and domain, so we don't need to change anything, but in actual implementation, you need to set the client id and domain in the following file. For more detail refer to Auth0 here:

.env
...
VITE_APP_AUTH0_CLIENT_ID=
VITE_APP_AUTH0_DOMAIN=
...

Change AuthProvider

..\src\App.jsx
import { Auth0Provider as AuthProvider } from './contexts/Auth0Context';

Change auth Hooks

Comment another context in the following file and uncomment Auth0 one.

..\src\hooks\useAuth.jsx
import AuthContext from '../contexts/Auth0Context';

Change login page view

Comment another Login page in the following file and uncomment Auth0 one.

..\src\views\auht\signin\SignIn1.jsx
import AuthLogin from './Auth0Login'
https://auth0.com/docs/get-started/auth0-overview