Skip to content

Commit

Permalink
Fine I fill use enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
actuallymentor committed Apr 3, 2024
1 parent 0b8d1fb commit bad1f98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modules/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { initializeApp } from "firebase/app"
import { getFirestore, doc, onSnapshot } from "firebase/firestore"
import { getAnalytics, logEvent } from "firebase/analytics"
import { getFunctions, httpsCallable, connectFunctionsEmulator } from 'firebase/functions'
import { initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check'
import { initializeAppCheck, ReCaptchaEnterpriseProvider, ReCaptchaV3Provider } from 'firebase/app-check'

import { log } from './helpers'

Expand All @@ -12,7 +12,7 @@ import { log } from './helpers'
// ///////////////////////////////

// Firebase config
const { VITE_apiKey, VITE_authDomain, VITE_projectId, VITE_storageBucket, VITE_messagingSenderId, VITE_appId, VITE_measurementId, VITE_recaptcha_site_key, VITE_APPCHECK_DEBUG_TOKEN } = import.meta.env
const { VITE_apiKey, VITE_authDomain, VITE_projectId, VITE_storageBucket, VITE_messagingSenderId, VITE_appId, VITE_measurementId, VITE_recaptcha_site_key, VITE_recaptcha_enterprise_site_key, VITE_APPCHECK_DEBUG_TOKEN } = import.meta.env
const config = {
apiKey: VITE_apiKey,
authDomain: VITE_authDomain,
Expand Down Expand Up @@ -43,9 +43,10 @@ const db = () => {

// App check config
if( import.meta.env.NODE_ENV === 'development' || VITE_APPCHECK_DEBUG_TOKEN ) self.FIREBASE_APPCHECK_DEBUG_TOKEN = VITE_APPCHECK_DEBUG_TOKEN || true
log( 'Initialising app check with ', VITE_APPCHECK_DEBUG_TOKEN || VITE_recaptcha_site_key )
log( 'Initialising app check with ', { VITE_APPCHECK_DEBUG_TOKEN, VITE_recaptcha_site_key, VITE_recaptcha_enterprise_site_key } )
const appcheck = initializeAppCheck( app(), {
provider: new ReCaptchaV3Provider( VITE_recaptcha_site_key ),
...VITE_recaptcha_site_key && { provider: new ReCaptchaV3Provider( VITE_recaptcha_site_key ) },
...VITE_recaptcha_enterprise_site_key && { provider: new ReCaptchaEnterpriseProvider( VITE_recaptcha_enterprise_site_key ) },
isTokenAutoRefreshEnabled: true
} )

Expand Down

0 comments on commit bad1f98

Please sign in to comment.