@firebase/auth 0.23.0 → 0.23.1-canary.5a2ceb07b

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 (67) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/auth-public.d.ts +6 -6
  3. package/dist/auth.d.ts +6 -6
  4. package/dist/browser-cjs/{index-8174c221.js → index-8d45fc10.js} +15 -17
  5. package/dist/browser-cjs/index-8d45fc10.js.map +1 -0
  6. package/dist/browser-cjs/index.js +1 -1
  7. package/dist/browser-cjs/internal.js +1 -1
  8. package/dist/browser-cjs/src/model/public_types.d.ts +9 -6
  9. package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  10. package/dist/browser-cjs/src/platform_browser/strategies/popup.d.ts +1 -1
  11. package/dist/cordova/index.js +2 -2
  12. package/dist/cordova/internal.js +6 -4
  13. package/dist/cordova/internal.js.map +1 -1
  14. package/dist/cordova/{popup_redirect-fedd78b2.js → popup_redirect-83844584.js} +11 -15
  15. package/dist/cordova/popup_redirect-83844584.js.map +1 -0
  16. package/dist/cordova/src/model/public_types.d.ts +9 -6
  17. package/dist/cordova/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  18. package/dist/cordova/src/platform_browser/strategies/popup.d.ts +1 -1
  19. package/dist/esm2017/{index-16e22603.js → index-e9b0713f.js} +15 -17
  20. package/dist/esm2017/index-e9b0713f.js.map +1 -0
  21. package/dist/esm2017/index.js +1 -1
  22. package/dist/esm2017/internal.js +2 -2
  23. package/dist/esm2017/src/model/public_types.d.ts +9 -6
  24. package/dist/esm2017/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  25. package/dist/esm2017/src/platform_browser/strategies/popup.d.ts +1 -1
  26. package/dist/esm5/{index-932ba0f0.js → index-7449f217.js} +15 -17
  27. package/dist/esm5/index-7449f217.js.map +1 -0
  28. package/dist/esm5/index.js +1 -1
  29. package/dist/esm5/internal.js +2 -2
  30. package/dist/esm5/src/model/public_types.d.ts +9 -6
  31. package/dist/esm5/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  32. package/dist/esm5/src/platform_browser/strategies/popup.d.ts +1 -1
  33. package/dist/index.webworker.esm5.js +10 -14
  34. package/dist/index.webworker.esm5.js.map +1 -1
  35. package/dist/node/index.js +1 -1
  36. package/dist/node/internal.js +1 -1
  37. package/dist/node/src/model/public_types.d.ts +9 -6
  38. package/dist/node/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  39. package/dist/node/src/platform_browser/strategies/popup.d.ts +1 -1
  40. package/dist/node/{totp-919eeeb3.js → totp-d0eab181.js} +11 -15
  41. package/dist/node/totp-d0eab181.js.map +1 -0
  42. package/dist/node-esm/index.js +1 -1
  43. package/dist/node-esm/internal.js +2 -2
  44. package/dist/node-esm/src/model/public_types.d.ts +9 -6
  45. package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  46. package/dist/node-esm/src/platform_browser/strategies/popup.d.ts +1 -1
  47. package/dist/node-esm/{totp-abcc15a3.js → totp-7c3eacfe.js} +11 -15
  48. package/dist/node-esm/totp-7c3eacfe.js.map +1 -0
  49. package/dist/rn/index.js +1 -1
  50. package/dist/rn/internal.js +5 -3
  51. package/dist/rn/internal.js.map +1 -1
  52. package/dist/rn/{phone-1dccf30c.js → phone-b00876b2.js} +11 -15
  53. package/dist/rn/phone-b00876b2.js.map +1 -0
  54. package/dist/rn/src/model/public_types.d.ts +9 -6
  55. package/dist/rn/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  56. package/dist/rn/src/platform_browser/strategies/popup.d.ts +1 -1
  57. package/dist/src/model/public_types.d.ts +9 -6
  58. package/dist/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +1 -0
  59. package/dist/src/platform_browser/strategies/popup.d.ts +1 -1
  60. package/package.json +6 -6
  61. package/dist/browser-cjs/index-8174c221.js.map +0 -1
  62. package/dist/cordova/popup_redirect-fedd78b2.js.map +0 -1
  63. package/dist/esm2017/index-16e22603.js.map +0 -1
  64. package/dist/esm5/index-932ba0f0.js.map +0 -1
  65. package/dist/node/totp-919eeeb3.js.map +0 -1
  66. package/dist/node-esm/totp-abcc15a3.js.map +0 -1
  67. package/dist/rn/phone-1dccf30c.js.map +0 -1
@@ -278,7 +278,7 @@ export interface Auth {
278
278
  */
279
279
  useDeviceLanguage(): void;
280
280
  /**
281
- * Signs out the current user.
281
+ * Signs out the current user. This does not automatically revoke the user's ID token.
282
282
  */
283
283
  signOut(): Promise<void>;
284
284
  }
@@ -378,7 +378,7 @@ export interface ActionCodeInfo {
378
378
  /**
379
379
  * The type of operation that generated the action code.
380
380
  */
381
- operation: typeof ActionCodeOperationMap[keyof typeof ActionCodeOperationMap];
381
+ operation: (typeof ActionCodeOperationMap)[keyof typeof ActionCodeOperationMap];
382
382
  }
383
383
  /**
384
384
  * An enumeration of the possible email action types.
@@ -498,6 +498,9 @@ export interface AuthProvider {
498
498
  /**
499
499
  * An enum of factors that may be used for multifactor authentication.
500
500
  *
501
+ * Internally we use an enum type for FactorId, ActionCodeOperation, but there is a copy in https://github.com/firebase/firebase-js-sdk/blob/48a2096aec53a7eaa9ffcc2625016ecb9f90d113/packages/auth/src/model/enum_maps.ts#L23 that uses maps.
502
+ * const enums are better for tree-shaking, however can cause runtime errors if exposed in public APIs, example - https://github.com/microsoft/rushstack/issues/3058
503
+ * So, we expose enum maps publicly, but use const enums internally to get some tree-shaking benefit.
501
504
  * @internal
502
505
  */
503
506
  export declare const enum FactorId {
@@ -544,7 +547,7 @@ export interface ConfirmationResult {
544
547
  */
545
548
  export interface MultiFactorAssertion {
546
549
  /** The identifier of the second factor. */
547
- readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
550
+ readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap];
548
551
  }
549
552
  /**
550
553
  * The error thrown when the user needs to provide a second factor to sign in successfully.
@@ -583,7 +586,7 @@ export interface MultiFactorError extends AuthError {
583
586
  /**
584
587
  * The type of operation (sign-in, linking, or re-authentication) that raised the error.
585
588
  */
586
- readonly operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap];
589
+ readonly operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap];
587
590
  };
588
591
  }
589
592
  /**
@@ -599,7 +602,7 @@ export interface MultiFactorInfo {
599
602
  /** The enrollment date of the second factor formatted as a UTC string. */
600
603
  readonly enrollmentTime: string;
601
604
  /** The identifier of the second factor. */
602
- readonly factorId: typeof FactorIdMap[keyof typeof FactorIdMap];
605
+ readonly factorId: (typeof FactorIdMap)[keyof typeof FactorIdMap];
603
606
  }
604
607
  /**
605
608
  * The subclass of the {@link MultiFactorInfo} interface for phone number
@@ -987,7 +990,7 @@ export interface UserCredential {
987
990
  /**
988
991
  * The type of operation which was used to authenticate the user (such as sign-in or link).
989
992
  */
990
- operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap];
993
+ operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap];
991
994
  }
992
995
  /**
993
996
  * User profile information, visible only to the Firebase project's apps.
@@ -18,6 +18,7 @@ import { RecaptchaActionName } from '../../api';
18
18
  import { Auth } from '../../model/public_types';
19
19
  import { AuthInternal } from '../../model/auth';
20
20
  export declare const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = "recaptcha-enterprise";
21
+ export declare const FAKE_TOKEN = "NO_RECAPTCHA";
21
22
  export declare class RecaptchaEnterpriseVerifier {
22
23
  /**
23
24
  * Identifies the type of application verifier (e.g. "recaptcha-enterprise").
@@ -17,7 +17,7 @@
17
17
  import { Auth, AuthProvider, PopupRedirectResolver, User, UserCredential } from '../../model/public_types';
18
18
  import { Delay } from '../../core/util/delay';
19
19
  export declare const enum _Timeout {
20
- AUTH_EVENT = 2000
20
+ AUTH_EVENT = 8000
21
21
  }
22
22
  export declare const _POLL_WINDOW_CLOSE_TIMEOUT: Delay;
23
23
  /**
@@ -2201,6 +2201,7 @@ function _generateCallbackName(prefix) {
2201
2201
  /* eslint-disable @typescript-eslint/no-require-imports */
2202
2202
  const RECAPTCHA_ENTERPRISE_URL = 'https://www.google.com/recaptcha/enterprise.js?render=';
2203
2203
  const RECAPTCHA_ENTERPRISE_VERIFIER_TYPE = 'recaptcha-enterprise';
2204
+ const FAKE_TOKEN = 'NO_RECAPTCHA';
2204
2205
  class RecaptchaEnterpriseVerifier {
2205
2206
  /**
2206
2207
  *
@@ -2259,19 +2260,14 @@ class RecaptchaEnterpriseVerifier {
2259
2260
  const grecaptcha = window.grecaptcha;
2260
2261
  if (isEnterprise(grecaptcha)) {
2261
2262
  grecaptcha.enterprise.ready(() => {
2262
- try {
2263
- grecaptcha.enterprise
2264
- .execute(siteKey, { action })
2265
- .then(token => {
2266
- resolve(token);
2267
- })
2268
- .catch(error => {
2269
- reject(error);
2270
- });
2271
- }
2272
- catch (error) {
2273
- reject(error);
2274
- }
2263
+ grecaptcha.enterprise
2264
+ .execute(siteKey, { action })
2265
+ .then(token => {
2266
+ resolve(token);
2267
+ })
2268
+ .catch(() => {
2269
+ resolve(FAKE_TOKEN);
2270
+ });
2275
2271
  });
2276
2272
  }
2277
2273
  else {
@@ -8618,11 +8614,13 @@ class PopupOperation extends AbstractPopupRedirectOperation {
8618
8614
  if ((_b = (_a = this.authWindow) === null || _a === void 0 ? void 0 : _a.window) === null || _b === void 0 ? void 0 : _b.closed) {
8619
8615
  // Make sure that there is sufficient time for whatever action to
8620
8616
  // complete. The window could have closed but the sign in network
8621
- // call could still be in flight.
8617
+ // call could still be in flight. This is specifically true for
8618
+ // Firefox or if the opener is in an iframe, in which case the oauth
8619
+ // helper closes the popup.
8622
8620
  this.pollId = window.setTimeout(() => {
8623
8621
  this.pollId = null;
8624
8622
  this.reject(_createError(this.auth, "popup-closed-by-user" /* AuthErrorCode.POPUP_CLOSED_BY_USER */));
8625
- }, 2000 /* _Timeout.AUTH_EVENT */);
8623
+ }, 8000 /* _Timeout.AUTH_EVENT */);
8626
8624
  return;
8627
8625
  }
8628
8626
  this.pollId = window.setTimeout(poll, _POLL_WINDOW_CLOSE_TIMEOUT.get());
@@ -9866,7 +9864,7 @@ function _isEmptyString(input) {
9866
9864
  }
9867
9865
 
9868
9866
  var name = "@firebase/auth";
9869
- var version = "0.23.0";
9867
+ var version = "0.23.1-canary.5a2ceb07b";
9870
9868
 
9871
9869
  /**
9872
9870
  * @license
@@ -10091,4 +10089,4 @@ function getAuth(app = getApp()) {
10091
10089
  registerAuth("Browser" /* ClientPlatform.BROWSER */);
10092
10090
 
10093
10091
  export { signInWithCredential as $, ActionCodeOperation as A, signOut as B, deleteUser as C, debugErrorMap as D, prodErrorMap as E, FactorId as F, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as G, initializeAuth as H, connectAuthEmulator as I, AuthCredential as J, EmailAuthCredential as K, OAuthCredential as L, PhoneAuthCredential as M, inMemoryPersistence as N, OperationType as O, PhoneAuthProvider as P, EmailAuthProvider as Q, RecaptchaVerifier as R, SignInMethod as S, TotpMultiFactorGenerator as T, FacebookAuthProvider as U, GoogleAuthProvider as V, GithubAuthProvider as W, OAuthProvider as X, SAMLAuthProvider as Y, TwitterAuthProvider as Z, signInAnonymously as _, browserSessionPersistence as a, linkWithCredential as a0, reauthenticateWithCredential as a1, signInWithCustomToken as a2, sendPasswordResetEmail as a3, confirmPasswordReset as a4, applyActionCode as a5, checkActionCode as a6, verifyPasswordResetCode as a7, createUserWithEmailAndPassword as a8, signInWithEmailAndPassword as a9, _assert as aA, AuthEventManager as aB, _getInstance as aC, _persistenceKeyName as aD, _getRedirectResult as aE, _overrideRedirectResult as aF, _clearRedirectOutcomes as aG, _castAuth as aH, UserImpl as aI, AuthImpl as aJ, _getClientVersion as aK, _generateEventId as aL, AuthPopup as aM, FetchProvider as aN, SAMLAuthCredential as aO, sendSignInLinkToEmail as aa, isSignInWithEmailLink as ab, signInWithEmailLink as ac, fetchSignInMethodsForEmail as ad, sendEmailVerification as ae, verifyBeforeUpdateEmail as af, ActionCodeURL as ag, parseActionCodeURL as ah, updateProfile as ai, updateEmail as aj, updatePassword as ak, getIdToken as al, getIdTokenResult as am, unlink as an, getAdditionalUserInfo as ao, reload as ap, getMultiFactorResolver as aq, multiFactor as ar, debugAssert as as, _isIOS as at, _isAndroid as au, _fail as av, _getRedirectUrl as aw, _getProjectConfig as ax, _isIOS7Or8 as ay, _createError as az, browserLocalPersistence as b, signInWithPopup as c, linkWithPopup as d, reauthenticateWithPopup as e, signInWithRedirect as f, linkWithRedirect as g, reauthenticateWithRedirect as h, indexedDBLocalPersistence as i, getRedirectResult as j, browserPopupRedirectResolver as k, linkWithPhoneNumber as l, PhoneMultiFactorGenerator as m, TotpSecret as n, getAuth as o, ProviderId as p, setPersistence as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, initializeRecaptchaConfig as t, updatePhoneNumber as u, onIdTokenChanged as v, beforeAuthStateChanged as w, onAuthStateChanged as x, useDeviceLanguage as y, updateCurrentUser as z };
10094
- //# sourceMappingURL=index-16e22603.js.map
10092
+ //# sourceMappingURL=index-e9b0713f.js.map