@firebase/auth 1.3.2 → 1.4.0-canary.a89e05bfc

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 (102) hide show
  1. package/dist/auth-public.d.ts +10 -0
  2. package/dist/auth.d.ts +11 -0
  3. package/dist/browser-cjs/{index-770706ba.js → index-45eace57.js} +47 -5
  4. package/dist/browser-cjs/index-45eace57.js.map +1 -0
  5. package/dist/browser-cjs/index.js +2 -1
  6. package/dist/browser-cjs/index.js.map +1 -1
  7. package/dist/browser-cjs/internal.js +2 -1
  8. package/dist/browser-cjs/internal.js.map +1 -1
  9. package/dist/browser-cjs/src/api/account_management/email_and_password.d.ts +2 -0
  10. package/dist/browser-cjs/src/api/authentication/sign_up.d.ts +1 -0
  11. package/dist/browser-cjs/src/api/authentication/token.d.ts +13 -2
  12. package/dist/browser-cjs/src/api/index.d.ts +3 -1
  13. package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +4 -0
  14. package/dist/browser-cjs/src/core/index.d.ts +9 -0
  15. package/dist/browser-cjs/src/model/auth.d.ts +1 -0
  16. package/dist/cordova/index.js +2 -2
  17. package/dist/cordova/internal.js +2 -2
  18. package/dist/cordova/{popup_redirect-a9365a6c.js → popup_redirect-b9561938.js} +71 -9
  19. package/dist/cordova/popup_redirect-b9561938.js.map +1 -0
  20. package/dist/cordova/src/api/account_management/email_and_password.d.ts +2 -0
  21. package/dist/cordova/src/api/authentication/sign_up.d.ts +1 -0
  22. package/dist/cordova/src/api/authentication/token.d.ts +13 -2
  23. package/dist/cordova/src/api/index.d.ts +3 -1
  24. package/dist/cordova/src/core/auth/auth_impl.d.ts +4 -0
  25. package/dist/cordova/src/core/index.d.ts +9 -0
  26. package/dist/cordova/src/model/auth.d.ts +1 -0
  27. package/dist/esm2017/{index-94e5f531.js → index-7cf9b6e6.js} +47 -6
  28. package/dist/esm2017/index-7cf9b6e6.js.map +1 -0
  29. package/dist/esm2017/index.js +1 -1
  30. package/dist/esm2017/internal.js +2 -2
  31. package/dist/esm2017/src/api/account_management/email_and_password.d.ts +2 -0
  32. package/dist/esm2017/src/api/authentication/sign_up.d.ts +1 -0
  33. package/dist/esm2017/src/api/authentication/token.d.ts +13 -2
  34. package/dist/esm2017/src/api/index.d.ts +3 -1
  35. package/dist/esm2017/src/core/auth/auth_impl.d.ts +4 -0
  36. package/dist/esm2017/src/core/index.d.ts +9 -0
  37. package/dist/esm2017/src/model/auth.d.ts +1 -0
  38. package/dist/esm5/{index-7b6c682b.js → index-13ceeca9.js} +71 -9
  39. package/dist/esm5/index-13ceeca9.js.map +1 -0
  40. package/dist/esm5/index.js +1 -1
  41. package/dist/esm5/internal.js +2 -2
  42. package/dist/esm5/src/api/account_management/email_and_password.d.ts +2 -0
  43. package/dist/esm5/src/api/authentication/sign_up.d.ts +1 -0
  44. package/dist/esm5/src/api/authentication/token.d.ts +13 -2
  45. package/dist/esm5/src/api/index.d.ts +3 -1
  46. package/dist/esm5/src/core/auth/auth_impl.d.ts +4 -0
  47. package/dist/esm5/src/core/index.d.ts +9 -0
  48. package/dist/esm5/src/model/auth.d.ts +1 -0
  49. package/dist/index.webworker.esm5.js +70 -8
  50. package/dist/index.webworker.esm5.js.map +1 -1
  51. package/dist/node/index.js +2 -1
  52. package/dist/node/index.js.map +1 -1
  53. package/dist/node/internal.js +2 -1
  54. package/dist/node/internal.js.map +1 -1
  55. package/dist/node/src/api/account_management/email_and_password.d.ts +2 -0
  56. package/dist/node/src/api/authentication/sign_up.d.ts +1 -0
  57. package/dist/node/src/api/authentication/token.d.ts +13 -2
  58. package/dist/node/src/api/index.d.ts +3 -1
  59. package/dist/node/src/core/auth/auth_impl.d.ts +4 -0
  60. package/dist/node/src/core/index.d.ts +9 -0
  61. package/dist/node/src/model/auth.d.ts +1 -0
  62. package/dist/node/{totp-24a79064.js → totp-e8b77416.js} +71 -8
  63. package/dist/node/totp-e8b77416.js.map +1 -0
  64. package/dist/node-esm/index.js +1 -1
  65. package/dist/node-esm/internal.js +2 -2
  66. package/dist/node-esm/src/api/account_management/email_and_password.d.ts +2 -0
  67. package/dist/node-esm/src/api/authentication/sign_up.d.ts +1 -0
  68. package/dist/node-esm/src/api/authentication/token.d.ts +13 -2
  69. package/dist/node-esm/src/api/index.d.ts +3 -1
  70. package/dist/node-esm/src/core/auth/auth_impl.d.ts +4 -0
  71. package/dist/node-esm/src/core/index.d.ts +9 -0
  72. package/dist/node-esm/src/model/auth.d.ts +1 -0
  73. package/dist/node-esm/{totp-a0f18007.js → totp-caa6c436.js} +47 -6
  74. package/dist/node-esm/totp-caa6c436.js.map +1 -0
  75. package/dist/rn/{index-3d9ec48b.js → index-b0222f52.js} +71 -8
  76. package/dist/rn/index-b0222f52.js.map +1 -0
  77. package/dist/rn/index.js +2 -1
  78. package/dist/rn/index.js.map +1 -1
  79. package/dist/rn/internal.js +2 -1
  80. package/dist/rn/internal.js.map +1 -1
  81. package/dist/rn/src/api/account_management/email_and_password.d.ts +2 -0
  82. package/dist/rn/src/api/authentication/sign_up.d.ts +1 -0
  83. package/dist/rn/src/api/authentication/token.d.ts +13 -2
  84. package/dist/rn/src/api/index.d.ts +3 -1
  85. package/dist/rn/src/core/auth/auth_impl.d.ts +4 -0
  86. package/dist/rn/src/core/index.d.ts +9 -0
  87. package/dist/rn/src/model/auth.d.ts +1 -0
  88. package/dist/src/api/account_management/email_and_password.d.ts +2 -0
  89. package/dist/src/api/authentication/sign_up.d.ts +1 -0
  90. package/dist/src/api/authentication/token.d.ts +13 -2
  91. package/dist/src/api/index.d.ts +3 -1
  92. package/dist/src/core/auth/auth_impl.d.ts +4 -0
  93. package/dist/src/core/index.d.ts +9 -0
  94. package/dist/src/model/auth.d.ts +1 -0
  95. package/package.json +6 -6
  96. package/dist/browser-cjs/index-770706ba.js.map +0 -1
  97. package/dist/cordova/popup_redirect-a9365a6c.js.map +0 -1
  98. package/dist/esm2017/index-94e5f531.js.map +0 -1
  99. package/dist/esm5/index-7b6c682b.js.map +0 -1
  100. package/dist/node/totp-24a79064.js.map +0 -1
  101. package/dist/node-esm/totp-a0f18007.js.map +0 -1
  102. package/dist/rn/index-3d9ec48b.js.map +0 -1
@@ -1,4 +1,4 @@
1
- export { A as ActionCodeOperation, ah as ActionCodeURL, K as AuthCredential, H as AuthErrorCodes, L as EmailAuthCredential, U as EmailAuthProvider, V as FacebookAuthProvider, F as FactorId, X as GithubAuthProvider, W as GoogleAuthProvider, M as OAuthCredential, Y as OAuthProvider, O as OperationType, N as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, Z as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, _ as TwitterAuthProvider, a6 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a7 as checkActionCode, a5 as confirmPasswordReset, J as connectAuthEmulator, a9 as createUserWithEmailAndPassword, E as debugErrorMap, D as deleteUser, ae as fetchSignInMethodsForEmail, ap as getAdditionalUserInfo, o as getAuth, am as getIdToken, an as getIdTokenResult, ar as getMultiFactorResolver, j as getRedirectResult, Q as inMemoryPersistence, i as indexedDBLocalPersistence, I as initializeAuth, t as initializeRecaptchaConfig, ac as isSignInWithEmailLink, a1 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, as as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, ai as parseActionCodeURL, G as prodErrorMap, a2 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, aq as reload, af as sendEmailVerification, a4 as sendPasswordResetEmail, ab as sendSignInLinkToEmail, q as setPersistence, $ as signInAnonymously, a0 as signInWithCredential, a3 as signInWithCustomToken, aa as signInWithEmailAndPassword, ad as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ao as unlink, B as updateCurrentUser, ak as updateEmail, al as updatePassword, u as updatePhoneNumber, aj as updateProfile, z as useDeviceLanguage, v as validatePassword, ag as verifyBeforeUpdateEmail, a8 as verifyPasswordResetCode } from './totp-a0f18007.js';
1
+ export { A as ActionCodeOperation, ai as ActionCodeURL, L as AuthCredential, I as AuthErrorCodes, M as EmailAuthCredential, V as EmailAuthProvider, W as FacebookAuthProvider, F as FactorId, Y as GithubAuthProvider, X as GoogleAuthProvider, N as OAuthCredential, Z as OAuthProvider, O as OperationType, Q as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, _ as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, $ as TwitterAuthProvider, a7 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a8 as checkActionCode, a6 as confirmPasswordReset, K as connectAuthEmulator, aa as createUserWithEmailAndPassword, G as debugErrorMap, E as deleteUser, af as fetchSignInMethodsForEmail, aq as getAdditionalUserInfo, o as getAuth, an as getIdToken, ao as getIdTokenResult, as as getMultiFactorResolver, j as getRedirectResult, U as inMemoryPersistence, i as indexedDBLocalPersistence, J as initializeAuth, t as initializeRecaptchaConfig, ad as isSignInWithEmailLink, a2 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, at as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, aj as parseActionCodeURL, H as prodErrorMap, a3 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ar as reload, D as revokeAccessToken, ag as sendEmailVerification, a5 as sendPasswordResetEmail, ac as sendSignInLinkToEmail, q as setPersistence, a0 as signInAnonymously, a1 as signInWithCredential, a4 as signInWithCustomToken, ab as signInWithEmailAndPassword, ae as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ap as unlink, B as updateCurrentUser, al as updateEmail, am as updatePassword, u as updatePhoneNumber, ak as updateProfile, z as useDeviceLanguage, v as validatePassword, ah as verifyBeforeUpdateEmail, a9 as verifyPasswordResetCode } from './totp-caa6c436.js';
2
2
  import '@firebase/util';
3
3
  import '@firebase/app';
4
4
  import 'tslib';
@@ -1,5 +1,5 @@
1
- import { at as _getInstance, au as _assert, av as _signInWithCredential, aw as _reauthenticate, ax as _link$1, K as AuthCredential, ay as signInWithIdp, az as _fail, aA as debugAssert, aB as _persistenceKeyName, aC as _castAuth, aD as FederatedAuthProvider, aE as BaseOAuthProvider, aF as _emulatorUrl, aG as _performApiRequest, aH as _isIOS, aI as _isAndroid, aJ as _isIOS7Or8, aK as _createError, aL as _isIframe, aM as _isMobileBrowser, aN as _isIE10, aO as _isSafari } from './totp-a0f18007.js';
2
- export { A as ActionCodeOperation, ah as ActionCodeURL, K as AuthCredential, H as AuthErrorCodes, aQ as AuthImpl, L as EmailAuthCredential, U as EmailAuthProvider, V as FacebookAuthProvider, F as FactorId, aS as FetchProvider, X as GithubAuthProvider, W as GoogleAuthProvider, M as OAuthCredential, Y as OAuthProvider, O as OperationType, N as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, aT as SAMLAuthCredential, Z as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, _ as TwitterAuthProvider, aP as UserImpl, au as _assert, aC as _castAuth, az as _fail, aR as _getClientVersion, at as _getInstance, aB as _persistenceKeyName, a6 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a7 as checkActionCode, a5 as confirmPasswordReset, J as connectAuthEmulator, a9 as createUserWithEmailAndPassword, E as debugErrorMap, D as deleteUser, ae as fetchSignInMethodsForEmail, ap as getAdditionalUserInfo, o as getAuth, am as getIdToken, an as getIdTokenResult, ar as getMultiFactorResolver, j as getRedirectResult, Q as inMemoryPersistence, i as indexedDBLocalPersistence, I as initializeAuth, t as initializeRecaptchaConfig, ac as isSignInWithEmailLink, a1 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, as as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, ai as parseActionCodeURL, G as prodErrorMap, a2 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, aq as reload, af as sendEmailVerification, a4 as sendPasswordResetEmail, ab as sendSignInLinkToEmail, q as setPersistence, $ as signInAnonymously, a0 as signInWithCredential, a3 as signInWithCustomToken, aa as signInWithEmailAndPassword, ad as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ao as unlink, B as updateCurrentUser, ak as updateEmail, al as updatePassword, u as updatePhoneNumber, aj as updateProfile, z as useDeviceLanguage, v as validatePassword, ag as verifyBeforeUpdateEmail, a8 as verifyPasswordResetCode } from './totp-a0f18007.js';
1
+ import { au as _getInstance, av as _assert, aw as _signInWithCredential, ax as _reauthenticate, ay as _link$1, L as AuthCredential, az as signInWithIdp, aA as _fail, aB as debugAssert, aC as _persistenceKeyName, aD as _castAuth, aE as FederatedAuthProvider, aF as BaseOAuthProvider, aG as _emulatorUrl, aH as _performApiRequest, aI as _isIOS, aJ as _isAndroid, aK as _isIOS7Or8, aL as _createError, aM as _isIframe, aN as _isMobileBrowser, aO as _isIE10, aP as _isSafari } from './totp-caa6c436.js';
2
+ export { A as ActionCodeOperation, ai as ActionCodeURL, L as AuthCredential, I as AuthErrorCodes, aR as AuthImpl, M as EmailAuthCredential, V as EmailAuthProvider, W as FacebookAuthProvider, F as FactorId, aT as FetchProvider, Y as GithubAuthProvider, X as GoogleAuthProvider, N as OAuthCredential, Z as OAuthProvider, O as OperationType, Q as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, aU as SAMLAuthCredential, _ as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, $ as TwitterAuthProvider, aQ as UserImpl, av as _assert, aD as _castAuth, aA as _fail, aS as _getClientVersion, au as _getInstance, aC as _persistenceKeyName, a7 as applyActionCode, x as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a8 as checkActionCode, a6 as confirmPasswordReset, K as connectAuthEmulator, aa as createUserWithEmailAndPassword, G as debugErrorMap, E as deleteUser, af as fetchSignInMethodsForEmail, aq as getAdditionalUserInfo, o as getAuth, an as getIdToken, ao as getIdTokenResult, as as getMultiFactorResolver, j as getRedirectResult, U as inMemoryPersistence, i as indexedDBLocalPersistence, J as initializeAuth, t as initializeRecaptchaConfig, ad as isSignInWithEmailLink, a2 as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, at as multiFactor, y as onAuthStateChanged, w as onIdTokenChanged, aj as parseActionCodeURL, H as prodErrorMap, a3 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ar as reload, D as revokeAccessToken, ag as sendEmailVerification, a5 as sendPasswordResetEmail, ac as sendSignInLinkToEmail, q as setPersistence, a0 as signInAnonymously, a1 as signInWithCredential, a4 as signInWithCustomToken, ab as signInWithEmailAndPassword, ae as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, C as signOut, ap as unlink, B as updateCurrentUser, al as updateEmail, am as updatePassword, u as updatePhoneNumber, ak as updateProfile, z as useDeviceLanguage, v as validatePassword, ah as verifyBeforeUpdateEmail, a9 as verifyPasswordResetCode } from './totp-caa6c436.js';
3
3
  import { isEmpty, querystring, getUA, querystringDecode } from '@firebase/util';
4
4
  import 'tslib';
5
5
  import { SDK_VERSION } from '@firebase/app';
@@ -17,6 +17,7 @@
17
17
  import { ActionCodeOperation, Auth } from '../../model/public_types';
18
18
  import { IdTokenResponse } from '../../model/id_token';
19
19
  import { MfaEnrollment } from './mfa';
20
+ import { SignUpRequest, SignUpResponse } from '../authentication/sign_up';
20
21
  export interface ResetPasswordRequest {
21
22
  oobCode: string;
22
23
  newPassword?: string;
@@ -38,6 +39,7 @@ export interface UpdateEmailPasswordRequest {
38
39
  export interface UpdateEmailPasswordResponse extends IdTokenResponse {
39
40
  }
40
41
  export declare function updateEmailPassword(auth: Auth, request: UpdateEmailPasswordRequest): Promise<UpdateEmailPasswordResponse>;
42
+ export declare function linkEmailPassword(auth: Auth, request: SignUpRequest): Promise<SignUpResponse>;
41
43
  export interface ApplyActionCodeRequest {
42
44
  oobCode: string;
43
45
  tenantId?: string;
@@ -18,6 +18,7 @@ import { RecaptchaClientType, RecaptchaVersion } from '../index';
18
18
  import { IdTokenResponse } from '../../model/id_token';
19
19
  import { Auth } from '../../model/public_types';
20
20
  export interface SignUpRequest {
21
+ idToken?: string;
21
22
  returnSecureToken?: boolean;
22
23
  email?: string;
23
24
  password?: string;
@@ -15,12 +15,23 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { Auth } from '../../model/public_types';
18
- export declare const enum Endpoint {
19
- TOKEN = "/v1/token"
18
+ export declare const enum TokenType {
19
+ REFRESH_TOKEN = "REFRESH_TOKEN",
20
+ ACCESS_TOKEN = "ACCESS_TOKEN"
20
21
  }
21
22
  export interface RequestStsTokenResponse {
22
23
  accessToken: string;
23
24
  expiresIn: string;
24
25
  refreshToken: string;
25
26
  }
27
+ export interface RevokeTokenRequest {
28
+ providerId: string;
29
+ tokenType: TokenType;
30
+ token: string;
31
+ idToken: string;
32
+ tenantId?: string;
33
+ }
34
+ export interface RevokeTokenResponse {
35
+ }
26
36
  export declare function requestStsToken(auth: Auth, refreshToken: string): Promise<RequestStsTokenResponse>;
37
+ export declare function revokeToken(auth: Auth, request: RevokeTokenRequest): Promise<RevokeTokenResponse>;
@@ -54,7 +54,9 @@ export declare const enum Endpoint {
54
54
  WITHDRAW_MFA = "/v2/accounts/mfaEnrollment:withdraw",
55
55
  GET_PROJECT_CONFIG = "/v1/projects",
56
56
  GET_RECAPTCHA_CONFIG = "/v2/recaptchaConfig",
57
- GET_PASSWORD_POLICY = "/v2/passwordPolicy"
57
+ GET_PASSWORD_POLICY = "/v2/passwordPolicy",
58
+ TOKEN = "/v1/token",
59
+ REVOKE_TOKEN = "/v2/accounts:revokeToken"
58
60
  }
59
61
  export declare const enum RecaptchaClientType {
60
62
  WEB = "CLIENT_TYPE_WEB",
@@ -87,6 +87,10 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
87
87
  beforeAuthStateChanged(callback: (user: User | null) => void | Promise<void>, onAbort?: () => void): Unsubscribe;
88
88
  onIdTokenChanged(nextOrObserver: NextOrObserver<User>, error?: ErrorFn, completed?: CompleteFn): Unsubscribe;
89
89
  authStateReady(): Promise<void>;
90
+ /**
91
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
92
+ */
93
+ revokeAccessToken(token: string): Promise<void>;
90
94
  toJSON(): object;
91
95
  _setRedirectUser(user: UserInternal | null, popupRedirectResolver?: PopupRedirectResolver): Promise<void>;
92
96
  private getOrInitRedirectPersistenceManager;
@@ -171,6 +171,15 @@ export declare function updateCurrentUser(auth: Auth, user: User | null): Promis
171
171
  * @public
172
172
  */
173
173
  export declare function signOut(auth: Auth): Promise<void>;
174
+ /**
175
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
176
+ *
177
+ * @param auth - The {@link Auth} instance.
178
+ * @param token - The Apple OAuth access token.
179
+ *
180
+ * @public
181
+ */
182
+ export declare function revokeAccessToken(auth: Auth, token: string): Promise<void>;
174
183
  export { initializeAuth } from './auth/initialize';
175
184
  export { connectAuthEmulator } from './auth/emulator';
176
185
  export { AuthCredential } from './credentials';
@@ -83,4 +83,5 @@ export interface AuthInternal extends Auth {
83
83
  useDeviceLanguage(): void;
84
84
  signOut(): Promise<void>;
85
85
  validatePassword(password: string): Promise<PasswordValidationStatus>;
86
+ revokeAccessToken(token: string): Promise<void>;
86
87
  }
@@ -1522,6 +1522,9 @@ async function requestStsToken(auth, refreshToken) {
1522
1522
  expiresIn: response.expires_in,
1523
1523
  refreshToken: response.refresh_token
1524
1524
  };
1525
+ }
1526
+ async function revokeToken(auth, request) {
1527
+ return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts:revokeToken" /* Endpoint.REVOKE_TOKEN */, _addTidIfNecessary(auth, request));
1525
1528
  }
1526
1529
 
1527
1530
  /**
@@ -2787,6 +2790,25 @@ class AuthImpl {
2787
2790
  }
2788
2791
  });
2789
2792
  }
2793
+ /**
2794
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
2795
+ */
2796
+ async revokeAccessToken(token) {
2797
+ if (this.currentUser) {
2798
+ const idToken = await this.currentUser.getIdToken();
2799
+ // Generalize this to accept other providers once supported.
2800
+ const request = {
2801
+ providerId: 'apple.com',
2802
+ tokenType: "ACCESS_TOKEN" /* TokenType.ACCESS_TOKEN */,
2803
+ token,
2804
+ idToken
2805
+ };
2806
+ if (this.tenantId != null) {
2807
+ request.tenantId = this.tenantId;
2808
+ }
2809
+ await revokeToken(this, request);
2810
+ }
2811
+ }
2790
2812
  toJSON() {
2791
2813
  var _a;
2792
2814
  return {
@@ -3474,6 +3496,11 @@ async function resetPassword(auth, request) {
3474
3496
  async function updateEmailPassword(auth, request) {
3475
3497
  return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v1/accounts:update" /* Endpoint.SET_ACCOUNT_INFO */, request);
3476
3498
  }
3499
+ // Used for linking an email/password account to an existing idToken. Uses the same request/response
3500
+ // format as updateEmailPassword.
3501
+ async function linkEmailPassword(auth, request) {
3502
+ return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v1/accounts:signUp" /* Endpoint.SIGN_UP */, request);
3503
+ }
3477
3504
  async function applyActionCode$1(auth, request) {
3478
3505
  return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v1/accounts:update" /* Endpoint.SET_ACCOUNT_INFO */, _addTidIfNecessary(auth, request));
3479
3506
  }
@@ -3637,12 +3664,14 @@ class EmailAuthCredential extends AuthCredential {
3637
3664
  async _linkToIdToken(auth, idToken) {
3638
3665
  switch (this.signInMethod) {
3639
3666
  case "password" /* SignInMethod.EMAIL_PASSWORD */:
3640
- return updateEmailPassword(auth, {
3667
+ const request = {
3641
3668
  idToken,
3642
3669
  returnSecureToken: true,
3643
3670
  email: this._email,
3644
- password: this._password
3645
- });
3671
+ password: this._password,
3672
+ clientType: "CLIENT_TYPE_WEB" /* RecaptchaClientType.WEB */
3673
+ };
3674
+ return handleRecaptchaFlow(auth, request, "signUpPassword" /* RecaptchaActionName.SIGN_UP_PASSWORD */, linkEmailPassword);
3646
3675
  case "emailLink" /* SignInMethod.EMAIL_LINK */:
3647
3676
  return signInWithEmailLinkForLinking(auth, {
3648
3677
  idToken,
@@ -6483,6 +6512,18 @@ function updateCurrentUser(auth, user) {
6483
6512
  function signOut(auth) {
6484
6513
  return getModularInstance(auth).signOut();
6485
6514
  }
6515
+ /**
6516
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
6517
+ *
6518
+ * @param auth - The {@link Auth} instance.
6519
+ * @param token - The Apple OAuth access token.
6520
+ *
6521
+ * @public
6522
+ */
6523
+ function revokeAccessToken(auth, token) {
6524
+ const authInternal = _castAuth(auth);
6525
+ return authInternal.revokeAccessToken(token);
6526
+ }
6486
6527
  /**
6487
6528
  * Deletes and signs out the user.
6488
6529
  *
@@ -6721,7 +6762,7 @@ function multiFactor(user) {
6721
6762
  }
6722
6763
 
6723
6764
  var name = "@firebase/auth";
6724
- var version = "1.3.2";
6765
+ var version = "1.4.0-canary.a89e05bfc";
6725
6766
 
6726
6767
  /**
6727
6768
  * @license
@@ -7130,5 +7171,5 @@ function _isEmptyString(input) {
7130
7171
  return typeof input === 'undefined' || (input === null || input === void 0 ? void 0 : input.length) === 0;
7131
7172
  }
7132
7173
 
7133
- export { signInAnonymously as $, ActionCodeOperation as A, updateCurrentUser as B, signOut as C, deleteUser as D, debugErrorMap as E, FactorId as F, prodErrorMap as G, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as H, initializeAuth as I, connectAuthEmulator as J, AuthCredential as K, EmailAuthCredential as L, OAuthCredential as M, PhoneAuthCredential as N, OperationType as O, PhoneAuthProvider as P, inMemoryPersistence as Q, RecaptchaVerifier as R, SignInMethod as S, TotpMultiFactorGenerator as T, EmailAuthProvider as U, FacebookAuthProvider as V, GoogleAuthProvider as W, GithubAuthProvider as X, OAuthProvider as Y, SAMLAuthProvider as Z, TwitterAuthProvider as _, browserSessionPersistence as a, signInWithCredential as a0, linkWithCredential as a1, reauthenticateWithCredential as a2, signInWithCustomToken as a3, sendPasswordResetEmail as a4, confirmPasswordReset as a5, applyActionCode as a6, checkActionCode as a7, verifyPasswordResetCode as a8, createUserWithEmailAndPassword as a9, debugAssert as aA, _persistenceKeyName as aB, _castAuth as aC, FederatedAuthProvider as aD, BaseOAuthProvider as aE, _emulatorUrl as aF, _performApiRequest as aG, _isIOS as aH, _isAndroid as aI, _isIOS7Or8 as aJ, _createError as aK, _isIframe as aL, _isMobileBrowser as aM, _isIE10 as aN, _isSafari as aO, UserImpl as aP, AuthImpl as aQ, _getClientVersion as aR, FetchProvider as aS, SAMLAuthCredential as aT, signInWithEmailAndPassword as aa, sendSignInLinkToEmail as ab, isSignInWithEmailLink as ac, signInWithEmailLink as ad, fetchSignInMethodsForEmail as ae, sendEmailVerification as af, verifyBeforeUpdateEmail as ag, ActionCodeURL as ah, parseActionCodeURL as ai, updateProfile as aj, updateEmail as ak, updatePassword as al, getIdToken as am, getIdTokenResult as an, unlink as ao, getAdditionalUserInfo as ap, reload as aq, getMultiFactorResolver as ar, multiFactor as as, _getInstance as at, _assert as au, _signInWithCredential as av, _reauthenticate as aw, _link as ax, signInWithIdp as ay, _fail 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, validatePassword as v, onIdTokenChanged as w, beforeAuthStateChanged as x, onAuthStateChanged as y, useDeviceLanguage as z };
7134
- //# sourceMappingURL=totp-a0f18007.js.map
7174
+ export { TwitterAuthProvider as $, ActionCodeOperation as A, updateCurrentUser as B, signOut as C, revokeAccessToken as D, deleteUser as E, FactorId as F, debugErrorMap as G, prodErrorMap as H, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as I, initializeAuth as J, connectAuthEmulator as K, AuthCredential as L, EmailAuthCredential as M, OAuthCredential as N, OperationType as O, PhoneAuthProvider as P, PhoneAuthCredential as Q, RecaptchaVerifier as R, SignInMethod as S, TotpMultiFactorGenerator as T, inMemoryPersistence as U, EmailAuthProvider as V, FacebookAuthProvider as W, GoogleAuthProvider as X, GithubAuthProvider as Y, OAuthProvider as Z, SAMLAuthProvider as _, browserSessionPersistence as a, signInAnonymously as a0, signInWithCredential as a1, linkWithCredential as a2, reauthenticateWithCredential as a3, signInWithCustomToken as a4, sendPasswordResetEmail as a5, confirmPasswordReset as a6, applyActionCode as a7, checkActionCode as a8, verifyPasswordResetCode as a9, _fail as aA, debugAssert as aB, _persistenceKeyName as aC, _castAuth as aD, FederatedAuthProvider as aE, BaseOAuthProvider as aF, _emulatorUrl as aG, _performApiRequest as aH, _isIOS as aI, _isAndroid as aJ, _isIOS7Or8 as aK, _createError as aL, _isIframe as aM, _isMobileBrowser as aN, _isIE10 as aO, _isSafari as aP, UserImpl as aQ, AuthImpl as aR, _getClientVersion as aS, FetchProvider as aT, SAMLAuthCredential as aU, createUserWithEmailAndPassword as aa, signInWithEmailAndPassword as ab, sendSignInLinkToEmail as ac, isSignInWithEmailLink as ad, signInWithEmailLink as ae, fetchSignInMethodsForEmail as af, sendEmailVerification as ag, verifyBeforeUpdateEmail as ah, ActionCodeURL as ai, parseActionCodeURL as aj, updateProfile as ak, updateEmail as al, updatePassword as am, getIdToken as an, getIdTokenResult as ao, unlink as ap, getAdditionalUserInfo as aq, reload as ar, getMultiFactorResolver as as, multiFactor as at, _getInstance as au, _assert as av, _signInWithCredential as aw, _reauthenticate as ax, _link as ay, signInWithIdp 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, validatePassword as v, onIdTokenChanged as w, beforeAuthStateChanged as x, onAuthStateChanged as y, useDeviceLanguage as z };
7175
+ //# sourceMappingURL=totp-caa6c436.js.map