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

Switch to Firebase

PreviousSwitch to Auth0NextSwitch to AWS Cognito

Last updated 1 year ago

JWT to Firebase

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 

REACT_APP_FIREBASE_API_KEY=
REACT_APP_FIREBASE_AUTH_DOMAIN=
REACT_APP_FIREBASE_PROJECT_ID=
REACT_APP_FIREBASE_STORAGE_BUCKET=
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=
REACT_APP_FIREBASE_APP_ID=
REACT_APP_FIREBASE_MEASUREMENT_ID=
###
...

Change AuthProvider

..\src\App.js
import { FirebaseProvider as AuthProvider } from 'contexts/FirebaseContext';

Change auth Hooks

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

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

Copy login code

It's also super simple. We have provided a code that just needs to be replaced.

  • From: src\sections\auth\login\FirebaseLogin

  • To: src\sections\auth\auth-forms\AuthLogin.js

Copy register code

We have provided a code that just needs to be replaced.

  • From: src\sections\auth\register\FirebaseRegister

  • To: src\sections\auth\auth-forms\AuthRegister.js

For nextJS, refer next-auth site:

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