Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

se agregó appCheck con recaptchaprovider de firebase #42

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
VITE_API_F_KEY: ${{ secrets.VITE_API_F_KEY }}
VITE_BASE_ID: ${{ secrets.VITE_BASE_ID }}
VITE_FIREBASE_KEY: ${{ secrets.VITE_FIREBASE_KEY }}
VITE_RECAPTCHA_KEY: ${{ secrets.VITE_RECAPTCHA_KEY}}
run: |
echo "VITE_API_F_KEY=$VITE_API_F_KEY" >> .env
echo "VITE_BASE_ID=$VITE_BASE_ID" >> .env
echo "VITE_FIREBASE_KEY=$VITE_FIREBASE_KEY" >> .env
echo "VITE_RECAPTCHA_KEY=$VITE_RECAPTCHA_KEY" >> .env

- uses: actions/checkout@v2
- name: Install modules
Expand Down
Binary file modified .yarn/install-state.gz
Binary file not shown.
11 changes: 11 additions & 0 deletions services/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { initializeApp } from "firebase/app";
import { getStorage, ref, uploadBytes, getDownloadURL } from "firebase/storage";
import constants from "./constants";
import { initializeAppCheck, ReCaptchaV3Provider } from "firebase/app-check";

const firebaseConfig = {
apiKey: constants.firebaseKey,
Expand All @@ -16,4 +17,14 @@ const firebaseConfig = {
const app = initializeApp(firebaseConfig);
const storage = getStorage(app);

// Pass your reCAPTCHA v3 site key (public key) to activate(). Make sure this
// key is the counterpart to the secret key you set in the Firebase console.
initializeAppCheck(app, {
provider: new ReCaptchaV3Provider(constants.reCaptchaKey),

// Optional argument. If true, the SDK automatically refreshes App Check
// tokens as needed.
isTokenAutoRefreshEnabled: true,
});

export { storage, ref, uploadBytes, getDownloadURL };
Loading