Kevin
Kevin

Reputation: 1233

Flutter FireAuth remove reCAPTCHA banner (WEB)

I am creating a flutter web app and I am using firebase auth to authenticate users with phone number.

await _auth.signInWithPhoneNumber(phoneNumber);

After executing this command, a reCAPTCHA banner appears at the bottom right corner of the page. After completing the reCAPTCHA test, the banner doesn't come off. Even after confirming the sms:

await confirmationResult!.confirm(smsCode);

enter image description here

enter image description here

How can I remove this banner completely?

Upvotes: 5

Views: 1536

Answers (3)

akash
akash

Reputation: 21

This worked for me. Put this in index.html

<style>
    .grecaptcha-badge { visibility: hidden;}
</style>

Upvotes: 2

Vladimir Koltunov
Vladimir Koltunov

Reputation: 668

On web you must call signInWithPhoneNumber instead of verifyPhoneNumber.

ConfirmationResult confirmationResult = await auth.signInWithPhoneNumber('+44 7123 123 456');

See: Phone Authentication | Firebase

Upvotes: 2

Kevin
Kevin

Reputation: 1233

Apperently it is easy:

final el = window.document.getElementById('__ff-recaptcha-container');
if (el != null) {
    el.style.visibility = 'hidden';
}

Upvotes: 4

Related Questions