Skip to content

Commit 9931033

Browse files
authoredJul 10, 2023
Update phone auth snippets with RecaptchaVerifier parameter reordering (#348)
* Update phone auth snippets with RecaptchaVerifier parameter reordering * Update auth-next dependency to v10
1 parent 7156e6c commit 9931033

5 files changed

+11
-11
lines changed
 

‎auth-next/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
},
77
"license": "Apache-2.0",
88
"dependencies": {
9-
"firebase": "^9.22.2"
9+
"firebase": "^10.0.0"
1010
}
1111
}

‎auth-next/phone-auth.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ function recaptchaVerifierInvisible() {
1515
const { getAuth, RecaptchaVerifier } = require("firebase/auth");
1616

1717
const auth = getAuth();
18-
window.recaptchaVerifier = new RecaptchaVerifier('sign-in-button', {
18+
window.recaptchaVerifier = new RecaptchaVerifier(auth, 'sign-in-button', {
1919
'size': 'invisible',
2020
'callback': (response) => {
2121
// reCAPTCHA solved, allow signInWithPhoneNumber.
2222
onSignInSubmit();
2323
}
24-
}, auth);
24+
});
2525
// [END auth_phone_recaptcha_verifier_invisible]
2626
}
2727

@@ -30,7 +30,7 @@ function recaptchaVerifierVisible() {
3030
const { getAuth, RecaptchaVerifier } = require("firebase/auth");
3131

3232
const auth = getAuth();
33-
window.recaptchaVerifier = new RecaptchaVerifier('recaptcha-container', {
33+
window.recaptchaVerifier = new RecaptchaVerifier(auth, 'recaptcha-container', {
3434
'size': 'normal',
3535
'callback': (response) => {
3636
// reCAPTCHA solved, allow signInWithPhoneNumber.
@@ -40,7 +40,7 @@ function recaptchaVerifierVisible() {
4040
// Response expired. Ask user to solve reCAPTCHA again.
4141
// ...
4242
}
43-
}, auth);
43+
});
4444
// [END auth_phone_recaptcha_verifier_visible]
4545
}
4646

@@ -49,7 +49,7 @@ function recaptchaVerifierSimple() {
4949
const { getAuth, RecaptchaVerifier } = require("firebase/auth");
5050

5151
const auth = getAuth();
52-
window.recaptchaVerifier = new RecaptchaVerifier('recaptcha-container', {}, auth);
52+
window.recaptchaVerifier = new RecaptchaVerifier(auth, 'recaptcha-container', {});
5353
// [END auth_phone_recaptcha_verifier_simple]
5454
}
5555

‎snippets/auth-next/phone-auth/auth_phone_recaptcha_verifier_invisible.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import { getAuth, RecaptchaVerifier } from "firebase/auth";
99

1010
const auth = getAuth();
11-
window.recaptchaVerifier = new RecaptchaVerifier('sign-in-button', {
11+
window.recaptchaVerifier = new RecaptchaVerifier(auth, 'sign-in-button', {
1212
'size': 'invisible',
1313
'callback': (response) => {
1414
// reCAPTCHA solved, allow signInWithPhoneNumber.
1515
onSignInSubmit();
1616
}
17-
}, auth);
17+
});
1818
// [END auth_phone_recaptcha_verifier_invisible_modular]

‎snippets/auth-next/phone-auth/auth_phone_recaptcha_verifier_simple.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
import { getAuth, RecaptchaVerifier } from "firebase/auth";
99

1010
const auth = getAuth();
11-
window.recaptchaVerifier = new RecaptchaVerifier('recaptcha-container', {}, auth);
11+
window.recaptchaVerifier = new RecaptchaVerifier(auth, 'recaptcha-container', {});
1212
// [END auth_phone_recaptcha_verifier_simple_modular]

‎snippets/auth-next/phone-auth/auth_phone_recaptcha_verifier_visible.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { getAuth, RecaptchaVerifier } from "firebase/auth";
99

1010
const auth = getAuth();
11-
window.recaptchaVerifier = new RecaptchaVerifier('recaptcha-container', {
11+
window.recaptchaVerifier = new RecaptchaVerifier(auth, 'recaptcha-container', {
1212
'size': 'normal',
1313
'callback': (response) => {
1414
// reCAPTCHA solved, allow signInWithPhoneNumber.
@@ -18,5 +18,5 @@ window.recaptchaVerifier = new RecaptchaVerifier('recaptcha-container', {
1818
// Response expired. Ask user to solve reCAPTCHA again.
1919
// ...
2020
}
21-
}, auth);
21+
});
2222
// [END auth_phone_recaptcha_verifier_visible_modular]

0 commit comments

Comments
 (0)