Mantis MUI React
v3.5.0
v3.5.0
  • Documentation
  • Pre-requisites
  • Quick Start
  • Package
  • Folder Structure
  • State Management
  • Internationalization
  • Authentication
    • Switch to Auth0
    • Switch to Firebase
    • Switch to AWS Cognito
    • Switch to Supabase
  • Axios API Calls
  • Routing
  • Project Configuration
  • Color Presets
  • Theme/Style Configuration
  • How to
    • Login as First Page
    • Dashboard as First Page
    • Render Menu from the backend
    • Remove menu render from Backend
    • Remove Authentication
      • Vite
      • NextJS
  • Figma
  • Integration
    • Seed
    • To Existing Project
    • Comparison
  • Components
    • Avatar
    • BreadCrumb
    • Button
    • Dot
    • Main Card
    • Progress
    • SnackBar
    • Tooltip
    • Transitions
  • Dependencies
  • Roadmap
  • Support
  • Changelog
  • Mantis Eco System
  • FAQ
Powered by GitBook
On this page
  1. Authentication

Switch to Firebase

PreviousSwitch to Auth0NextSwitch to AWS Cognito

JWT to Firebase

  1. Set Firebase Config

At present, firebase uses you need to set a secret in the following file. For more detail refer to firebase here:

.env
...
###
## Firebase - Google Auth 

VITE_APP_FIREBASE_API_KEY=
VITE_APP_FIREBASE_AUTH_DOMAIN=
VITE_APP_FIREBASE_PROJECT_ID=
VITE_APP_FIREBASE_STORAGE_BUCKET=
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=
VITE_APP_FIREBASE_APP_ID=
VITE_APP_FIREBASE_MEASUREMENT_ID=
###
...
  1. Change Config

src\config.Js
export const APP_AUTH: AuthProvider = AuthProvider.FIREBASE;
  1. Change AuthProvider

Comment another provider in the following file and uncomment the Firebase one.

src/App.tsx
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';
  1. Change Auth Hooks

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

src/hooks/useAuth.ts
import AuthContext from 'contexts/FirebaseContext';

JWT to Firebase

  1. Set Firebase Config

.env
...
###
## Firebase - Google Auth 

VITE_APP_FIREBASE_API_KEY=
VITE_APP_FIREBASE_AUTH_DOMAIN=
VITE_APP_FIREBASE_PROJECT_ID=
VITE_APP_FIREBASE_STORAGE_BUCKET=
VITE_APP_FIREBASE_MESSAGING_SENDER_ID=
VITE_APP_FIREBASE_APP_ID=
VITE_APP_FIREBASE_MEASUREMENT_ID=
###
...
  1. Change Config

src\config.Js
export const APP_AUTH: AuthProvider = AuthProvider.FIREBASE;
  1. Change AuthProvider

Comment another provider in the following file and uncomment the Firebase one.

src/App.Jsx
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';
  1. Change Auth Hooks

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

src/hooks/useAuth.Js
import AuthContext from 'contexts/FirebaseContext';

At present, firebase uses you need to set a secret in the following file. For more detail refer to firebase here:

For nextJS, refer next-auth site:

For nextJS, refer next-auth site:

https://firebase.google.com/docs/reference/rest/auth
https://firebase.google.com/docs/reference/rest/auth
https://authjs.dev/reference/core/providers_google
https://authjs.dev/reference/core/providers_google