Switch to Firebase

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: https://firebase.google.com/docs/reference/rest/auth

.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=
###
...

Change Config

src\config.ts
export const APP_AUTH: AuthProvider = AuthProvider.FIREBASE;

Change AuthProvider

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

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

Change Auth Hooks

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

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

For nextJS, refer next-auth site: https://authjs.dev/reference/core/providers_google

Last updated