@firebase/auth 0.21.0-canary.d4114a4f7 → 0.21.0-canary.e9bcd4c43

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 (45) hide show
  1. package/dist/auth-public.d.ts +9 -2
  2. package/dist/auth.d.ts +9 -2
  3. package/dist/cordova/index.js +2 -2
  4. package/dist/cordova/internal.js +2 -2
  5. package/dist/cordova/{popup_redirect-64b43834.js → popup_redirect-00c236a4.js} +44 -10
  6. package/dist/cordova/{popup_redirect-64b43834.js.map → popup_redirect-00c236a4.js.map} +1 -1
  7. package/dist/cordova/src/platform_browser/strategies/redirect.d.ts +9 -2
  8. package/dist/cordova/test/helpers/mock_auth.d.ts +1 -1
  9. package/dist/esm2017/{index-af94c4d0.js → index-191b4cc1.js} +23 -4
  10. package/dist/esm2017/{index-af94c4d0.js.map → index-191b4cc1.js.map} +1 -1
  11. package/dist/esm2017/index.js +1 -1
  12. package/dist/esm2017/internal.js +2 -2
  13. package/dist/esm2017/src/platform_browser/strategies/redirect.d.ts +9 -2
  14. package/dist/esm2017/test/helpers/mock_auth.d.ts +1 -1
  15. package/dist/esm5/{index-947b0930.js → index-74ce35b8.js} +44 -10
  16. package/dist/esm5/{index-947b0930.js.map → index-74ce35b8.js.map} +1 -1
  17. package/dist/esm5/index.js +1 -1
  18. package/dist/esm5/internal.js +2 -2
  19. package/dist/esm5/src/platform_browser/strategies/redirect.d.ts +9 -2
  20. package/dist/esm5/test/helpers/mock_auth.d.ts +1 -1
  21. package/dist/index.webworker.esm5.js +1 -1
  22. package/dist/node/{index-04edd8db.js → index-b67e9c86.js} +2 -2
  23. package/dist/node/{index-04edd8db.js.map → index-b67e9c86.js.map} +1 -1
  24. package/dist/node/index.js +1 -1
  25. package/dist/node/internal.js +1 -1
  26. package/dist/node/internal.js.map +1 -1
  27. package/dist/node/src/platform_browser/strategies/redirect.d.ts +9 -2
  28. package/dist/node/test/helpers/mock_auth.d.ts +1 -1
  29. package/dist/node-esm/{index-24e378d4.js → index-9b5d62ed.js} +2 -2
  30. package/dist/node-esm/{index-24e378d4.js.map → index-9b5d62ed.js.map} +1 -1
  31. package/dist/node-esm/index.js +1 -1
  32. package/dist/node-esm/internal.js +2 -2
  33. package/dist/node-esm/internal.js.map +1 -1
  34. package/dist/node-esm/src/platform_browser/strategies/redirect.d.ts +9 -2
  35. package/dist/node-esm/test/helpers/mock_auth.d.ts +1 -1
  36. package/dist/rn/index.js +1 -1
  37. package/dist/rn/internal.js +43 -9
  38. package/dist/rn/internal.js.map +1 -1
  39. package/dist/rn/{phone-0253303a.js → phone-a713ebbf.js} +2 -2
  40. package/dist/rn/{phone-0253303a.js.map → phone-a713ebbf.js.map} +1 -1
  41. package/dist/rn/src/platform_browser/strategies/redirect.d.ts +9 -2
  42. package/dist/rn/test/helpers/mock_auth.d.ts +1 -1
  43. package/dist/src/platform_browser/strategies/redirect.d.ts +9 -2
  44. package/dist/test/helpers/mock_auth.d.ts +1 -1
  45. package/package.json +6 -6
@@ -1627,6 +1627,9 @@ export declare function linkWithPopup(user: User, provider: AuthProvider, resolv
1627
1627
 
1628
1628
  /**
1629
1629
  * Links the {@link OAuthProvider} to the user account using a full-page redirect flow.
1630
+ * @remarks
1631
+ * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
1632
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link linkWithRedirect}.
1630
1633
  *
1631
1634
  * @example
1632
1635
  * ```javascript
@@ -2593,6 +2596,9 @@ export declare function reauthenticateWithPopup(user: User, provider: AuthProvid
2593
2596
 
2594
2597
  /**
2595
2598
  * Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.
2599
+ * @remarks
2600
+ * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
2601
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link reauthenticateWithRedirect}.
2596
2602
  *
2597
2603
  * @example
2598
2604
  * ```javascript
@@ -2603,8 +2609,8 @@ export declare function reauthenticateWithPopup(user: User, provider: AuthProvid
2603
2609
  *
2604
2610
  * // After returning from the redirect when your app initializes you can obtain the result
2605
2611
  * const result = await getRedirectResult(auth);
2606
- * // Link using a redirect.
2607
- * await linkWithRedirect(result.user, provider);
2612
+ * // Reauthenticate using a redirect.
2613
+ * await reauthenticateWithRedirect(result.user, provider);
2608
2614
  * // This will again trigger a full page redirect away from your app
2609
2615
  *
2610
2616
  * // After returning from the redirect when your app initializes you can obtain the result
@@ -3092,6 +3098,7 @@ export declare function signInWithPopup(auth: Auth, provider: AuthProvider, reso
3092
3098
  *
3093
3099
  * @remarks
3094
3100
  * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
3101
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link signInWithRedirect}.
3095
3102
  *
3096
3103
  * @example
3097
3104
  * ```javascript
package/dist/auth.d.ts CHANGED
@@ -1948,6 +1948,9 @@ export declare function linkWithPopup(user: User, provider: AuthProvider, resolv
1948
1948
 
1949
1949
  /**
1950
1950
  * Links the {@link OAuthProvider} to the user account using a full-page redirect flow.
1951
+ * @remarks
1952
+ * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
1953
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link linkWithRedirect}.
1951
1954
  *
1952
1955
  * @example
1953
1956
  * ```javascript
@@ -2982,6 +2985,9 @@ export declare function reauthenticateWithPopup(user: User, provider: AuthProvid
2982
2985
 
2983
2986
  /**
2984
2987
  * Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.
2988
+ * @remarks
2989
+ * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
2990
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link reauthenticateWithRedirect}.
2985
2991
  *
2986
2992
  * @example
2987
2993
  * ```javascript
@@ -2992,8 +2998,8 @@ export declare function reauthenticateWithPopup(user: User, provider: AuthProvid
2992
2998
  *
2993
2999
  * // After returning from the redirect when your app initializes you can obtain the result
2994
3000
  * const result = await getRedirectResult(auth);
2995
- * // Link using a redirect.
2996
- * await linkWithRedirect(result.user, provider);
3001
+ * // Reauthenticate using a redirect.
3002
+ * await reauthenticateWithRedirect(result.user, provider);
2997
3003
  * // This will again trigger a full page redirect away from your app
2998
3004
  *
2999
3005
  * // After returning from the redirect when your app initializes you can obtain the result
@@ -3516,6 +3522,7 @@ export declare function signInWithPopup(auth: Auth, provider: AuthProvider, reso
3516
3522
  *
3517
3523
  * @remarks
3518
3524
  * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
3525
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link signInWithRedirect}.
3519
3526
  *
3520
3527
  * @example
3521
3528
  * ```javascript
@@ -1,6 +1,6 @@
1
1
  import { getApp, _getProvider } from '@firebase/app';
2
- import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-64b43834.js';
3
- export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-64b43834.js';
2
+ import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-00c236a4.js';
3
+ export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-00c236a4.js';
4
4
  import 'tslib';
5
5
  import '@firebase/util';
6
6
  import '@firebase/component';
@@ -1,5 +1,5 @@
1
- import { af as _performApiRequest, ag as _addTidIfNecessary, ah as _createError, ai as _assert, aj as Delay, ak as _window, al as _isHttpOrHttps, am as _isWorker, an as _castAuth, J as signInWithCredential, K as linkWithCredential, ao as _assertLinkedStatus, L as reauthenticateWithCredential, ap as sendPhoneVerificationCode, aq as startEnrollPhoneMfa, ar as _link, x as PhoneAuthCredential, as as debugAssert, at as _generateEventId, au as AbstractPopupRedirectOperation, av as _assertInstanceOf, aw as _withDefaultResolver, ax as FederatedAuthProvider, ay as _fail, az as _getProjectConfig, aA as _getCurrentUrl, aB as _emulatorUrl, aC as _isChromeIOS, aD as _isFirefox, aE as _isIOSStandalone, aF as _getRedirectUrl, aG as _setWindowLocation, aH as _isMobileBrowser, aI as _isSafari, aJ as _isIOS, f as browserSessionPersistence, aK as _getRedirectResult, aL as _overrideRedirectResult, aM as AuthEventManager, aN as debugFail, aO as finalizeEnrollPhoneMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, h as beforeAuthStateChanged, o as onIdTokenChanged, t as connectAuthEmulator } from './popup_redirect-64b43834.js';
2
- export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, aS as AuthImpl, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, aU as FetchProvider, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, aV as SAMLAuthCredential, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, aQ as UserImpl, ai as _assert, an as _castAuth, ay as _fail, at as _generateEventId, aT as _getClientVersion, aR as _getInstance, aK as _getRedirectResult, aL as _overrideRedirectResult, aP as _persistenceKeyName, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, aX as linkWithRedirect, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, aY as reauthenticateWithRedirect, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, aW as signInWithRedirect, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-64b43834.js';
1
+ import { af as _performApiRequest, ag as _addTidIfNecessary, ah as _createError, ai as _assert, aj as Delay, ak as _window, al as _isHttpOrHttps, am as _isWorker, an as _castAuth, J as signInWithCredential, K as linkWithCredential, ao as _assertLinkedStatus, L as reauthenticateWithCredential, ap as sendPhoneVerificationCode, aq as startEnrollPhoneMfa, ar as _link, x as PhoneAuthCredential, as as debugAssert, at as _generateEventId, au as AbstractPopupRedirectOperation, av as _assertInstanceOf, aw as _withDefaultResolver, ax as FederatedAuthProvider, ay as _fail, az as _getProjectConfig, aA as _getCurrentUrl, aB as _emulatorUrl, aC as _isChromeIOS, aD as _isFirefox, aE as _isIOSStandalone, aF as _getRedirectUrl, aG as _setWindowLocation, aH as _isMobileBrowser, aI as _isSafari, aJ as _isIOS, f as browserSessionPersistence, aK as _getRedirectResult, aL as _overrideRedirectResult, aM as AuthEventManager, aN as debugFail, aO as finalizeEnrollPhoneMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, h as beforeAuthStateChanged, o as onIdTokenChanged, t as connectAuthEmulator } from './popup_redirect-00c236a4.js';
2
+ export { A as ActionCodeOperation, a3 as ActionCodeURL, v as AuthCredential, q as AuthErrorCodes, aS as AuthImpl, E as EmailAuthCredential, z as EmailAuthProvider, B as FacebookAuthProvider, F as FactorId, aU as FetchProvider, C as GithubAuthProvider, G as GoogleAuthProvider, w as OAuthCredential, D as OAuthProvider, O as OperationType, x as PhoneAuthCredential, P as ProviderId, aV as SAMLAuthCredential, H as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, aQ as UserImpl, ai as _assert, an as _castAuth, ay as _fail, at as _generateEventId, aT as _getClientVersion, aR as _getInstance, aK as _getRedirectResult, aL as _overrideRedirectResult, aP as _persistenceKeyName, R as applyActionCode, h as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, U as checkActionCode, Q as confirmPasswordReset, t as connectAuthEmulator, d as cordovaPopupRedirectResolver, W as createUserWithEmailAndPassword, n as debugErrorMap, m as deleteUser, a0 as fetchSignInMethodsForEmail, ab as getAdditionalUserInfo, a8 as getIdToken, a9 as getIdTokenResult, ad as getMultiFactorResolver, g as getRedirectResult, y as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, Z as isSignInWithEmailLink, K as linkWithCredential, aX as linkWithRedirect, ae as multiFactor, j as onAuthStateChanged, o as onIdTokenChanged, a4 as parseActionCodeURL, p as prodErrorMap, L as reauthenticateWithCredential, aY as reauthenticateWithRedirect, ac as reload, a1 as sendEmailVerification, N as sendPasswordResetEmail, Y as sendSignInLinkToEmail, s as setPersistence, I as signInAnonymously, J as signInWithCredential, M as signInWithCustomToken, X as signInWithEmailAndPassword, $ as signInWithEmailLink, aW as signInWithRedirect, l as signOut, aa as unlink, k as updateCurrentUser, a6 as updateEmail, a7 as updatePassword, a5 as updateProfile, u as useDeviceLanguage, a2 as verifyBeforeUpdateEmail, V as verifyPasswordResetCode } from './popup_redirect-00c236a4.js';
3
3
  import { __awaiter, __generator, __assign, __extends, __spreadArray } from 'tslib';
4
4
  import { querystring, getModularInstance, getUA, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
5
5
  import { SDK_VERSION, getApp, _getProvider } from '@firebase/app';
@@ -7887,7 +7887,7 @@ function multiFactor(user) {
7887
7887
  }
7888
7888
 
7889
7889
  var name = "@firebase/auth";
7890
- var version = "0.21.0-canary.d4114a4f7";
7890
+ var version = "0.21.0-canary.e9bcd4c43";
7891
7891
 
7892
7892
  /**
7893
7893
  * @license
@@ -8908,6 +8908,7 @@ function pendingRedirectKey(auth) {
8908
8908
  *
8909
8909
  * @remarks
8910
8910
  * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
8911
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link signInWithRedirect}.
8911
8912
  *
8912
8913
  * @example
8913
8914
  * ```javascript
@@ -8953,9 +8954,18 @@ function _signInWithRedirect(auth, provider, resolver) {
8953
8954
  case 0:
8954
8955
  authInternal = _castAuth(auth);
8955
8956
  _assertInstanceOf(auth, provider, FederatedAuthProvider);
8957
+ // Wait for auth initialization to complete, this will process pending redirects and clear the
8958
+ // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
8959
+ // redirect and creating a PENDING_REDIRECT_KEY entry.
8960
+ return [4 /*yield*/, authInternal._initializationPromise];
8961
+ case 1:
8962
+ // Wait for auth initialization to complete, this will process pending redirects and clear the
8963
+ // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
8964
+ // redirect and creating a PENDING_REDIRECT_KEY entry.
8965
+ _a.sent();
8956
8966
  resolverInternal = _withDefaultResolver(authInternal, resolver);
8957
8967
  return [4 /*yield*/, _setPendingRedirectStatus(resolverInternal, authInternal)];
8958
- case 1:
8968
+ case 2:
8959
8969
  _a.sent();
8960
8970
  return [2 /*return*/, resolverInternal._openRedirect(authInternal, provider, "signInViaRedirect" /* AuthEventType.SIGN_IN_VIA_REDIRECT */)];
8961
8971
  }
@@ -8964,6 +8974,9 @@ function _signInWithRedirect(auth, provider, resolver) {
8964
8974
  }
8965
8975
  /**
8966
8976
  * Reauthenticates the current user with the specified {@link OAuthProvider} using a full-page redirect flow.
8977
+ * @remarks
8978
+ * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
8979
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link reauthenticateWithRedirect}.
8967
8980
  *
8968
8981
  * @example
8969
8982
  * ```javascript
@@ -8974,8 +8987,8 @@ function _signInWithRedirect(auth, provider, resolver) {
8974
8987
  *
8975
8988
  * // After returning from the redirect when your app initializes you can obtain the result
8976
8989
  * const result = await getRedirectResult(auth);
8977
- * // Link using a redirect.
8978
- * await linkWithRedirect(result.user, provider);
8990
+ * // Reauthenticate using a redirect.
8991
+ * await reauthenticateWithRedirect(result.user, provider);
8979
8992
  * // This will again trigger a full page redirect away from your app
8980
8993
  *
8981
8994
  * // After returning from the redirect when your app initializes you can obtain the result
@@ -9001,12 +9014,21 @@ function _reauthenticateWithRedirect(user, provider, resolver) {
9001
9014
  case 0:
9002
9015
  userInternal = getModularInstance(user);
9003
9016
  _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);
9017
+ // Wait for auth initialization to complete, this will process pending redirects and clear the
9018
+ // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
9019
+ // redirect and creating a PENDING_REDIRECT_KEY entry.
9020
+ return [4 /*yield*/, userInternal.auth._initializationPromise];
9021
+ case 1:
9022
+ // Wait for auth initialization to complete, this will process pending redirects and clear the
9023
+ // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
9024
+ // redirect and creating a PENDING_REDIRECT_KEY entry.
9025
+ _a.sent();
9004
9026
  resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
9005
9027
  return [4 /*yield*/, _setPendingRedirectStatus(resolverInternal, userInternal.auth)];
9006
- case 1:
9028
+ case 2:
9007
9029
  _a.sent();
9008
9030
  return [4 /*yield*/, prepareUserForRedirect(userInternal)];
9009
- case 2:
9031
+ case 3:
9010
9032
  eventId = _a.sent();
9011
9033
  return [2 /*return*/, resolverInternal._openRedirect(userInternal.auth, provider, "reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */, eventId)];
9012
9034
  }
@@ -9015,6 +9037,9 @@ function _reauthenticateWithRedirect(user, provider, resolver) {
9015
9037
  }
9016
9038
  /**
9017
9039
  * Links the {@link OAuthProvider} to the user account using a full-page redirect flow.
9040
+ * @remarks
9041
+ * To handle the results and errors for this operation, refer to {@link getRedirectResult}.
9042
+ * Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using {@link linkWithRedirect}.
9018
9043
  *
9019
9044
  * @example
9020
9045
  * ```javascript
@@ -9049,15 +9074,24 @@ function _linkWithRedirect(user, provider, resolver) {
9049
9074
  case 0:
9050
9075
  userInternal = getModularInstance(user);
9051
9076
  _assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);
9077
+ // Wait for auth initialization to complete, this will process pending redirects and clear the
9078
+ // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
9079
+ // redirect and creating a PENDING_REDIRECT_KEY entry.
9080
+ return [4 /*yield*/, userInternal.auth._initializationPromise];
9081
+ case 1:
9082
+ // Wait for auth initialization to complete, this will process pending redirects and clear the
9083
+ // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
9084
+ // redirect and creating a PENDING_REDIRECT_KEY entry.
9085
+ _a.sent();
9052
9086
  resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
9053
9087
  return [4 /*yield*/, _assertLinkedStatus(false, userInternal, provider.providerId)];
9054
- case 1:
9088
+ case 2:
9055
9089
  _a.sent();
9056
9090
  return [4 /*yield*/, _setPendingRedirectStatus(resolverInternal, userInternal.auth)];
9057
- case 2:
9091
+ case 3:
9058
9092
  _a.sent();
9059
9093
  return [4 /*yield*/, prepareUserForRedirect(userInternal)];
9060
- case 3:
9094
+ case 4:
9061
9095
  eventId = _a.sent();
9062
9096
  return [2 /*return*/, resolverInternal._openRedirect(userInternal.auth, provider, "linkViaRedirect" /* AuthEventType.LINK_VIA_REDIRECT */, eventId)];
9063
9097
  }
@@ -10032,4 +10066,4 @@ function generateNoEvent() {
10032
10066
  }
10033
10067
 
10034
10068
  export { signInWithEmailLink as $, ActionCodeOperation as A, FacebookAuthProvider as B, GithubAuthProvider as C, OAuthProvider as D, EmailAuthCredential as E, FactorId as F, GoogleAuthProvider as G, SAMLAuthProvider as H, signInAnonymously as I, signInWithCredential as J, linkWithCredential as K, reauthenticateWithCredential as L, signInWithCustomToken as M, sendPasswordResetEmail as N, OperationType as O, ProviderId as P, confirmPasswordReset as Q, applyActionCode as R, SignInMethod as S, TwitterAuthProvider as T, checkActionCode as U, verifyPasswordResetCode as V, createUserWithEmailAndPassword as W, signInWithEmailAndPassword as X, sendSignInLinkToEmail as Y, isSignInWithEmailLink as Z, _signInWithRedirect as _, _reauthenticateWithRedirect as a, fetchSignInMethodsForEmail as a0, sendEmailVerification as a1, verifyBeforeUpdateEmail as a2, ActionCodeURL as a3, parseActionCodeURL as a4, updateProfile as a5, updateEmail as a6, updatePassword as a7, getIdToken as a8, getIdTokenResult as a9, _getCurrentUrl as aA, _emulatorUrl as aB, _isChromeIOS as aC, _isFirefox as aD, _isIOSStandalone as aE, _getRedirectUrl as aF, _setWindowLocation as aG, _isMobileBrowser as aH, _isSafari as aI, _isIOS as aJ, _getRedirectResult as aK, _overrideRedirectResult as aL, AuthEventManager as aM, debugFail as aN, finalizeEnrollPhoneMfa as aO, _persistenceKeyName as aP, UserImpl as aQ, _getInstance as aR, AuthImpl as aS, _getClientVersion as aT, FetchProvider as aU, SAMLAuthCredential as aV, signInWithRedirect as aW, linkWithRedirect as aX, reauthenticateWithRedirect as aY, unlink as aa, getAdditionalUserInfo as ab, reload as ac, getMultiFactorResolver as ad, multiFactor as ae, _performApiRequest as af, _addTidIfNecessary as ag, _createError as ah, _assert as ai, Delay as aj, _window as ak, _isHttpOrHttps as al, _isWorker as am, _castAuth as an, _assertLinkedStatus as ao, sendPhoneVerificationCode as ap, startEnrollPhoneMfa as aq, _link$1 as ar, debugAssert as as, _generateEventId as at, AbstractPopupRedirectOperation as au, _assertInstanceOf as av, _withDefaultResolver as aw, FederatedAuthProvider as ax, _fail as ay, _getProjectConfig as az, _linkWithRedirect as b, indexedDBLocalPersistence as c, cordovaPopupRedirectResolver as d, browserLocalPersistence as e, browserSessionPersistence as f, getRedirectResult as g, beforeAuthStateChanged as h, initializeAuth as i, onAuthStateChanged as j, updateCurrentUser as k, signOut as l, deleteUser as m, debugErrorMap as n, onIdTokenChanged as o, prodErrorMap as p, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as q, registerAuth as r, setPersistence as s, connectAuthEmulator as t, useDeviceLanguage as u, AuthCredential as v, OAuthCredential as w, PhoneAuthCredential as x, inMemoryPersistence as y, EmailAuthProvider as z };
10035
- //# sourceMappingURL=popup_redirect-64b43834.js.map
10069
+ //# sourceMappingURL=popup_redirect-00c236a4.js.map