@firebase/auth 1.13.3 → 1.13.4-20260728185501

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/browser-cjs/{index-80e3689c.js → index-TiyvRZm6.js} +119 -26
  2. package/dist/browser-cjs/{index-80e3689c.js.map → index-TiyvRZm6.js.map} +1 -1
  3. package/dist/browser-cjs/index.js +1 -1
  4. package/dist/browser-cjs/internal.js +1 -1
  5. package/dist/browser-cjs/internal.js.map +1 -1
  6. package/dist/cordova/index.js +9 -3
  7. package/dist/cordova/index.js.map +1 -1
  8. package/dist/cordova/internal.js +3 -3
  9. package/dist/cordova/internal.js.map +1 -1
  10. package/dist/cordova/{popup_redirect-167cbb8f.js → popup_redirect-Be0Melsy.js} +148 -55
  11. package/dist/cordova/popup_redirect-Be0Melsy.js.map +1 -0
  12. package/dist/esm/{index-d90d2ee5.js → index-DqtyKhzu.js} +120 -27
  13. package/dist/esm/{index-d90d2ee5.js.map → index-DqtyKhzu.js.map} +1 -1
  14. package/dist/esm/index.js +1 -1
  15. package/dist/esm/internal.js +3 -3
  16. package/dist/esm/internal.js.map +1 -1
  17. package/dist/index.webworker.js +124 -70
  18. package/dist/index.webworker.js.map +1 -1
  19. package/dist/node/index.js +1 -1
  20. package/dist/node/internal.js +1 -1
  21. package/dist/node/internal.js.map +1 -1
  22. package/dist/node/{totp-9e84e53d.js → totp-D8cjDKiH.js} +30 -47
  23. package/dist/node/{totp-9e84e53d.js.map → totp-D8cjDKiH.js.map} +1 -1
  24. package/dist/node-esm/index.js +1 -1
  25. package/dist/node-esm/internal.js +3 -3
  26. package/dist/node-esm/internal.js.map +1 -1
  27. package/dist/node-esm/{totp-65577477.js → totp-BkwAJFrn.js} +31 -48
  28. package/dist/node-esm/{totp-65577477.js.map → totp-BkwAJFrn.js.map} +1 -1
  29. package/dist/rn/{index-7d302f10.js → index-BzcHGbdh.js} +24 -2
  30. package/dist/rn/{index-7d302f10.js.map → index-BzcHGbdh.js.map} +1 -1
  31. package/dist/rn/index.js +7 -1
  32. package/dist/rn/index.js.map +1 -1
  33. package/dist/rn/internal.js +96 -25
  34. package/dist/rn/internal.js.map +1 -1
  35. package/dist/web-extension-cjs/index.js +2 -1
  36. package/dist/web-extension-cjs/index.js.map +1 -1
  37. package/dist/web-extension-cjs/internal.js +1 -1
  38. package/dist/web-extension-cjs/internal.js.map +1 -1
  39. package/dist/web-extension-cjs/{register-1fdfc769.js → register-Bk5zU3vt.js} +119 -26
  40. package/dist/{web-extension-esm/register-293ebff1.js.map → web-extension-cjs/register-Bk5zU3vt.js.map} +1 -1
  41. package/dist/web-extension-esm/index.js +4 -3
  42. package/dist/web-extension-esm/index.js.map +1 -1
  43. package/dist/web-extension-esm/internal.js +3 -3
  44. package/dist/web-extension-esm/internal.js.map +1 -1
  45. package/dist/web-extension-esm/{register-293ebff1.js → register-CGKCII54.js} +120 -27
  46. package/dist/{web-extension-cjs/register-1fdfc769.js.map → web-extension-esm/register-CGKCII54.js.map} +1 -1
  47. package/package.json +13 -12
  48. package/dist/cordova/popup_redirect-167cbb8f.js.map +0 -1
@@ -1560,6 +1560,7 @@ function extractProviderData(providers) {
1560
1560
  * See the License for the specific language governing permissions and
1561
1561
  * limitations under the License.
1562
1562
  */
1563
+ /* eslint-disable camelcase */
1563
1564
  async function requestStsToken(auth, refreshToken) {
1564
1565
  const response = await _performFetchWithErrorHandling(auth, {}, async () => {
1565
1566
  const body = util.querystring({
@@ -3289,6 +3290,22 @@ class MockGreCAPTCHA {
3289
3290
  }
3290
3291
 
3291
3292
  /* eslint-disable @typescript-eslint/no-require-imports */
3293
+ /**
3294
+ * @license
3295
+ * Copyright 2022 Google LLC
3296
+ *
3297
+ * Licensed under the Apache License, Version 2.0 (the "License");
3298
+ * you may not use this file except in compliance with the License.
3299
+ * You may obtain a copy of the License at
3300
+ *
3301
+ * http://www.apache.org/licenses/LICENSE-2.0
3302
+ *
3303
+ * Unless required by applicable law or agreed to in writing, software
3304
+ * distributed under the License is distributed on an "AS IS" BASIS,
3305
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3306
+ * See the License for the specific language governing permissions and
3307
+ * limitations under the License.
3308
+ */
3292
3309
  const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = 'recaptcha-enterprise';
3293
3310
  const FAKE_TOKEN = 'NO_RECAPTCHA';
3294
3311
  const RECAPTCHA_ENTERPRISE_ONLOAD_CALLBACK_NAME = 'onFirebaseAuthREInstanceReady';
@@ -3488,7 +3505,7 @@ async function injectRecaptchaFields(auth, request, action, isCaptchaResp = fals
3488
3505
  return newRequest;
3489
3506
  }
3490
3507
  async function handleRecaptchaFlow(authInstance, request, actionName, actionMethod, recaptchaAuthProvider) {
3491
- if (recaptchaAuthProvider === "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */) {
3508
+ {
3492
3509
  if (authInstance
3493
3510
  ._getRecaptchaConfig()
3494
3511
  ?.isProviderEnabled("EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */)) {
@@ -3508,45 +3525,6 @@ async function handleRecaptchaFlow(authInstance, request, actionName, actionMeth
3508
3525
  });
3509
3526
  }
3510
3527
  }
3511
- else if (recaptchaAuthProvider === "PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */) {
3512
- if (authInstance
3513
- ._getRecaptchaConfig()
3514
- ?.isProviderEnabled("PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */)) {
3515
- const requestWithRecaptcha = await injectRecaptchaFields(authInstance, request, actionName);
3516
- return actionMethod(authInstance, requestWithRecaptcha).catch(async (error) => {
3517
- if (authInstance
3518
- ._getRecaptchaConfig()
3519
- ?.getProviderEnforcementState("PHONE_PROVIDER" /* RecaptchaAuthProvider.PHONE_PROVIDER */) === "AUDIT" /* EnforcementState.AUDIT */) {
3520
- // AUDIT mode
3521
- if (error.code === `auth/${"missing-recaptcha-token" /* AuthErrorCode.MISSING_RECAPTCHA_TOKEN */}` ||
3522
- error.code === `auth/${"invalid-app-credential" /* AuthErrorCode.INVALID_APP_CREDENTIAL */}`) {
3523
- console.log(`Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ${actionName} flow.`);
3524
- // reCAPTCHA Enterprise token is missing or reCAPTCHA Enterprise token
3525
- // check fails.
3526
- // Fallback to reCAPTCHA v2 flow.
3527
- const requestWithRecaptchaFields = await injectRecaptchaFields(authInstance, request, actionName, false, // isCaptchaResp
3528
- true // isFakeToken
3529
- );
3530
- // This will call the PhoneApiCaller to fetch and inject reCAPTCHA v2 token.
3531
- return actionMethod(authInstance, requestWithRecaptchaFields);
3532
- }
3533
- }
3534
- // ENFORCE mode or AUDIT mode with any other error.
3535
- return Promise.reject(error);
3536
- });
3537
- }
3538
- else {
3539
- // Do reCAPTCHA v2 flow.
3540
- const requestWithRecaptchaFields = await injectRecaptchaFields(authInstance, request, actionName, false, // isCaptchaResp
3541
- true // isFakeToken
3542
- );
3543
- // This will call the PhoneApiCaller to fetch and inject v2 token.
3544
- return actionMethod(authInstance, requestWithRecaptchaFields);
3545
- }
3546
- }
3547
- else {
3548
- return Promise.reject(recaptchaAuthProvider + ' provider is not supported.');
3549
- }
3550
3528
  }
3551
3529
  async function _initializeRecaptchaConfig(auth) {
3552
3530
  const authInternal = _castAuth(auth);
@@ -4005,7 +3983,7 @@ class EmailAuthCredential extends AuthCredential {
4005
3983
  password: this._password,
4006
3984
  clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
4007
3985
  };
4008
- return handleRecaptchaFlow(auth, request, "signInWithPassword" /* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */, signInWithPassword, "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */);
3986
+ return handleRecaptchaFlow(auth, request, "signInWithPassword" /* RecaptchaActionName.SIGN_IN_WITH_PASSWORD */, signInWithPassword);
4009
3987
  case "emailLink" /* SignInMethod.EMAIL_LINK */:
4010
3988
  return signInWithEmailLink$1(auth, {
4011
3989
  email: this._email,
@@ -4026,7 +4004,7 @@ class EmailAuthCredential extends AuthCredential {
4026
4004
  password: this._password,
4027
4005
  clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
4028
4006
  };
4029
- return handleRecaptchaFlow(auth, request, "signUpPassword" /* RecaptchaActionName.SIGN_UP_PASSWORD */, linkEmailPassword, "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */);
4007
+ return handleRecaptchaFlow(auth, request, "signUpPassword" /* RecaptchaActionName.SIGN_UP_PASSWORD */, linkEmailPassword);
4030
4008
  case "emailLink" /* SignInMethod.EMAIL_LINK */:
4031
4009
  return signInWithEmailLinkForLinking(auth, {
4032
4010
  idToken,
@@ -5149,6 +5127,11 @@ GithubAuthProvider.PROVIDER_ID = "github.com" /* ProviderId.GITHUB */;
5149
5127
  * See the License for the specific language governing permissions and
5150
5128
  * limitations under the License.
5151
5129
  */
5130
+ /**
5131
+ * Represents the SAML credentials returned by an {@link SAMLAuthProvider}.
5132
+ *
5133
+ * @public
5134
+ */
5152
5135
  const IDP_REQUEST_URI = 'http://localhost';
5153
5136
  /**
5154
5137
  * @public
@@ -6027,7 +6010,7 @@ async function sendPasswordResetEmail(auth, email, actionCodeSettings) {
6027
6010
  if (actionCodeSettings) {
6028
6011
  _setActionCodeSettingsOnRequest(authInternal, request, actionCodeSettings);
6029
6012
  }
6030
- await handleRecaptchaFlow(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, sendPasswordResetEmail$1, "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */);
6013
+ await handleRecaptchaFlow(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, sendPasswordResetEmail$1);
6031
6014
  }
6032
6015
  /**
6033
6016
  * Completes the password reset process, given a confirmation code and new password.
@@ -6160,7 +6143,7 @@ async function createUserWithEmailAndPassword(auth, email, password) {
6160
6143
  password,
6161
6144
  clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
6162
6145
  };
6163
- const signUpResponse = handleRecaptchaFlow(authInternal, request, "signUpPassword" /* RecaptchaActionName.SIGN_UP_PASSWORD */, signUp, "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */);
6146
+ const signUpResponse = handleRecaptchaFlow(authInternal, request, "signUpPassword" /* RecaptchaActionName.SIGN_UP_PASSWORD */, signUp);
6164
6147
  const response = await signUpResponse.catch(error => {
6165
6148
  if (error.code === `auth/${"password-does-not-meet-requirements" /* AuthErrorCode.PASSWORD_DOES_NOT_MEET_REQUIREMENTS */}`) {
6166
6149
  void recachePasswordPolicy(auth);
@@ -6274,7 +6257,7 @@ async function sendSignInLinkToEmail(auth, email, actionCodeSettings) {
6274
6257
  }
6275
6258
  }
6276
6259
  setActionCodeSettings(request, actionCodeSettings);
6277
- await handleRecaptchaFlow(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, sendSignInLinkToEmail$1, "EMAIL_PASSWORD_PROVIDER" /* RecaptchaAuthProvider.EMAIL_PASSWORD_PROVIDER */);
6260
+ await handleRecaptchaFlow(authInternal, request, "getOobCode" /* RecaptchaActionName.GET_OOB_CODE */, sendSignInLinkToEmail$1);
6278
6261
  }
6279
6262
  /**
6280
6263
  * Checks if an incoming link is a sign-in with email link suitable for {@link signInWithEmailLink}.
@@ -7203,7 +7186,7 @@ function multiFactor(user) {
7203
7186
  }
7204
7187
 
7205
7188
  var name = "@firebase/auth";
7206
- var version = "1.13.3";
7189
+ var version = "1.13.4-20260728185501";
7207
7190
 
7208
7191
  /**
7209
7192
  * @license
@@ -7723,4 +7706,4 @@ exports.useDeviceLanguage = useDeviceLanguage;
7723
7706
  exports.validatePassword = validatePassword;
7724
7707
  exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
7725
7708
  exports.verifyPasswordResetCode = verifyPasswordResetCode;
7726
- //# sourceMappingURL=totp-9e84e53d.js.map
7709
+ //# sourceMappingURL=totp-D8cjDKiH.js.map