Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I implement firebase app-check in my Angular 12 application

I've tried the solutions provided in this question

Here's my code

// firebase-init.ts
import firebase from 'firebase/app';

import 'firebase/app-check';

import { environment } from 'src/environments/environment';

const app = firebase.initializeApp(environment.firebase);
const appCheck = app.appCheck();

appCheck.activate('KEY_HERE');

And here's my import to app.module.ts

// app.module.ts
import './firebase-init'

I get this error after running the code

I'm using Angular Universal for Server Side Rendering. Please help. What I'm I doing wrong?

like image 304
TR4C3S 0F 45H Avatar asked Aug 16 '26 21:08

TR4C3S 0F 45H


1 Answers

By the look of it it seems you are using the DEBUG TOKEN VALUE (generated in the console). Try using reCaptcha key and see if that resolves the issue.

Replace this: appCheck.activate('6LeatjUbAAAAAGn_iRsWgEFyf-lubXOUkaqyEJLJ');

With this: appCheck.activate('reCAPTCHA secret key');

Hint: click on the app row instead of context menu icon (three dots). It will slide down another row where you can see the reCaptcha button.

like image 110
Sohail Salehi Avatar answered Aug 19 '26 00:08

Sohail Salehi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!