@@ -129,7 +129,7 @@ class ConfirmationResultImpl implements ConfirmationResult {
129
129
export async function signInWithPhoneNumber (
130
130
auth : Auth ,
131
131
phoneNumber : string ,
132
- appVerifier : ApplicationVerifier
132
+ appVerifier ? : ApplicationVerifier
133
133
) : Promise < ConfirmationResult > {
134
134
if ( _isFirebaseServerApp ( auth . app ) ) {
135
135
return Promise . reject (
@@ -162,7 +162,7 @@ export async function signInWithPhoneNumber(
162
162
export async function linkWithPhoneNumber (
163
163
user : User ,
164
164
phoneNumber : string ,
165
- appVerifier : ApplicationVerifier
165
+ appVerifier ? : ApplicationVerifier
166
166
) : Promise < ConfirmationResult > {
167
167
const userInternal = getModularInstance ( user ) as UserInternal ;
168
168
await _assertLinkedStatus ( false , userInternal , ProviderId . PHONE ) ;
@@ -194,7 +194,7 @@ export async function linkWithPhoneNumber(
194
194
export async function reauthenticateWithPhoneNumber (
195
195
user : User ,
196
196
phoneNumber : string ,
197
- appVerifier : ApplicationVerifier
197
+ appVerifier ? : ApplicationVerifier
198
198
) : Promise < ConfirmationResult > {
199
199
const userInternal = getModularInstance ( user ) as UserInternal ;
200
200
if ( _isFirebaseServerApp ( userInternal . auth . app ) ) {
@@ -224,7 +224,7 @@ type PhoneApiCaller<TRequest, TResponse> = (
224
224
export async function _verifyPhoneNumber (
225
225
auth : AuthInternal ,
226
226
options : PhoneInfoOptions | string ,
227
- verifier : ApplicationVerifierInternal
227
+ verifier ? : ApplicationVerifierInternal
228
228
) : Promise < string > {
229
229
if ( ! auth . _getRecaptchaConfig ( ) ) {
230
230
const enterpriseVerifier = new RecaptchaEnterpriseVerifier ( auth ) ;
@@ -274,7 +274,7 @@ export async function _verifyPhoneNumber(
274
274
request . phoneEnrollmentInfo . captchaResponse === FAKE_TOKEN
275
275
) {
276
276
_assert (
277
- verifier . type === RECAPTCHA_VERIFIER_TYPE ,
277
+ verifier ? .type === RECAPTCHA_VERIFIER_TYPE ,
278
278
authInstance ,
279
279
AuthErrorCode . ARGUMENT_ERROR
280
280
) ;
@@ -329,14 +329,14 @@ export async function _verifyPhoneNumber(
329
329
authInstance : AuthInternal ,
330
330
request : StartPhoneMfaSignInRequest
331
331
) => {
332
- // If reCAPTCHA Enterprise token is empty or "NO_RECAPTCHA", fetch v2 token and inject into request.
332
+ // If reCAPTCHA Enterprise token is empty or "NO_RECAPTCHA", fetch reCAPTCHA v2 token and inject into request.
333
333
if (
334
334
! request . phoneSignInInfo . captchaResponse ||
335
335
request . phoneSignInInfo . captchaResponse . length === 0 ||
336
336
request . phoneSignInInfo . captchaResponse === FAKE_TOKEN
337
337
) {
338
338
_assert (
339
- verifier . type === RECAPTCHA_VERIFIER_TYPE ,
339
+ verifier ? .type === RECAPTCHA_VERIFIER_TYPE ,
340
340
authInstance ,
341
341
AuthErrorCode . ARGUMENT_ERROR
342
342
) ;
@@ -380,14 +380,14 @@ export async function _verifyPhoneNumber(
380
380
authInstance : AuthInternal ,
381
381
request : SendPhoneVerificationCodeRequest
382
382
) => {
383
- // If reCAPTCHA Enterprise token is empty or "NO_RECAPTCHA", fetch v2 token and inject into request.
383
+ // If reCAPTCHA Enterprise token is empty or "NO_RECAPTCHA", fetch reCAPTCHA v2 token and inject into request.
384
384
if (
385
385
! request . captchaResponse ||
386
386
request . captchaResponse . length === 0 ||
387
387
request . captchaResponse === FAKE_TOKEN
388
388
) {
389
389
_assert (
390
- verifier . type === RECAPTCHA_VERIFIER_TYPE ,
390
+ verifier ? .type === RECAPTCHA_VERIFIER_TYPE ,
391
391
authInstance ,
392
392
AuthErrorCode . ARGUMENT_ERROR
393
393
) ;
@@ -421,7 +421,7 @@ export async function _verifyPhoneNumber(
421
421
return response . sessionInfo ;
422
422
}
423
423
} finally {
424
- verifier . _reset ( ) ;
424
+ verifier ? ._reset ( ) ;
425
425
}
426
426
}
427
427
0 commit comments