@firebase/auth 1.3.2-canary.ff1a6ec2c → 1.4.0-20231107192534

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 (86) 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-605f94d7.js → index-dfd6ff50.js} +37 -2
  4. package/dist/browser-cjs/index-dfd6ff50.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/authentication/token.d.ts +13 -2
  10. package/dist/browser-cjs/src/api/index.d.ts +3 -1
  11. package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +4 -0
  12. package/dist/browser-cjs/src/core/index.d.ts +9 -0
  13. package/dist/browser-cjs/src/model/auth.d.ts +1 -0
  14. package/dist/cordova/index.js +2 -2
  15. package/dist/cordova/internal.js +2 -2
  16. package/dist/cordova/{popup_redirect-81d2b7d7.js → popup_redirect-b8968cb1.js} +53 -3
  17. package/dist/cordova/popup_redirect-b8968cb1.js.map +1 -0
  18. package/dist/cordova/src/api/authentication/token.d.ts +13 -2
  19. package/dist/cordova/src/api/index.d.ts +3 -1
  20. package/dist/cordova/src/core/auth/auth_impl.d.ts +4 -0
  21. package/dist/cordova/src/core/index.d.ts +9 -0
  22. package/dist/cordova/src/model/auth.d.ts +1 -0
  23. package/dist/esm2017/{index-f680024a.js → index-ae3ae6d8.js} +37 -3
  24. package/dist/esm2017/index-ae3ae6d8.js.map +1 -0
  25. package/dist/esm2017/index.js +1 -1
  26. package/dist/esm2017/internal.js +2 -2
  27. package/dist/esm2017/src/api/authentication/token.d.ts +13 -2
  28. package/dist/esm2017/src/api/index.d.ts +3 -1
  29. package/dist/esm2017/src/core/auth/auth_impl.d.ts +4 -0
  30. package/dist/esm2017/src/core/index.d.ts +9 -0
  31. package/dist/esm2017/src/model/auth.d.ts +1 -0
  32. package/dist/esm5/{index-a7eab1f1.js → index-7f85f824.js} +53 -3
  33. package/dist/esm5/index-7f85f824.js.map +1 -0
  34. package/dist/esm5/index.js +1 -1
  35. package/dist/esm5/internal.js +2 -2
  36. package/dist/esm5/src/api/authentication/token.d.ts +13 -2
  37. package/dist/esm5/src/api/index.d.ts +3 -1
  38. package/dist/esm5/src/core/auth/auth_impl.d.ts +4 -0
  39. package/dist/esm5/src/core/index.d.ts +9 -0
  40. package/dist/esm5/src/model/auth.d.ts +1 -0
  41. package/dist/index.webworker.esm5.js +52 -2
  42. package/dist/index.webworker.esm5.js.map +1 -1
  43. package/dist/node/index.js +2 -1
  44. package/dist/node/index.js.map +1 -1
  45. package/dist/node/internal.js +2 -1
  46. package/dist/node/internal.js.map +1 -1
  47. package/dist/node/src/api/authentication/token.d.ts +13 -2
  48. package/dist/node/src/api/index.d.ts +3 -1
  49. package/dist/node/src/core/auth/auth_impl.d.ts +4 -0
  50. package/dist/node/src/core/index.d.ts +9 -0
  51. package/dist/node/src/model/auth.d.ts +1 -0
  52. package/dist/node/{totp-53cf7541.js → totp-e17814fd.js} +53 -2
  53. package/dist/node/totp-e17814fd.js.map +1 -0
  54. package/dist/node-esm/index.js +1 -1
  55. package/dist/node-esm/internal.js +2 -2
  56. package/dist/node-esm/src/api/authentication/token.d.ts +13 -2
  57. package/dist/node-esm/src/api/index.d.ts +3 -1
  58. package/dist/node-esm/src/core/auth/auth_impl.d.ts +4 -0
  59. package/dist/node-esm/src/core/index.d.ts +9 -0
  60. package/dist/node-esm/src/model/auth.d.ts +1 -0
  61. package/dist/node-esm/{totp-581e665b.js → totp-2585fcd6.js} +37 -3
  62. package/dist/node-esm/totp-2585fcd6.js.map +1 -0
  63. package/dist/rn/{index-ef3f08bb.js → index-5104bca5.js} +53 -2
  64. package/dist/rn/index-5104bca5.js.map +1 -0
  65. package/dist/rn/index.js +2 -1
  66. package/dist/rn/index.js.map +1 -1
  67. package/dist/rn/internal.js +2 -1
  68. package/dist/rn/internal.js.map +1 -1
  69. package/dist/rn/src/api/authentication/token.d.ts +13 -2
  70. package/dist/rn/src/api/index.d.ts +3 -1
  71. package/dist/rn/src/core/auth/auth_impl.d.ts +4 -0
  72. package/dist/rn/src/core/index.d.ts +9 -0
  73. package/dist/rn/src/model/auth.d.ts +1 -0
  74. package/dist/src/api/authentication/token.d.ts +13 -2
  75. package/dist/src/api/index.d.ts +3 -1
  76. package/dist/src/core/auth/auth_impl.d.ts +4 -0
  77. package/dist/src/core/index.d.ts +9 -0
  78. package/dist/src/model/auth.d.ts +1 -0
  79. package/package.json +6 -6
  80. package/dist/browser-cjs/index-605f94d7.js.map +0 -1
  81. package/dist/cordova/popup_redirect-81d2b7d7.js.map +0 -1
  82. package/dist/esm2017/index-f680024a.js.map +0 -1
  83. package/dist/esm5/index-a7eab1f1.js.map +0 -1
  84. package/dist/node/totp-53cf7541.js.map +0 -1
  85. package/dist/node-esm/totp-581e665b.js.map +0 -1
  86. package/dist/rn/index-ef3f08bb.js.map +0 -1
@@ -2941,6 +2941,16 @@ export declare class RecaptchaVerifier implements ApplicationVerifierInternal {
2941
2941
  */
2942
2942
  export declare function reload(user: User): Promise<void>;
2943
2943
 
2944
+ /**
2945
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
2946
+ *
2947
+ * @param auth - The {@link Auth} instance.
2948
+ * @param token - The Apple OAuth access token.
2949
+ *
2950
+ * @public
2951
+ */
2952
+ export declare function revokeAccessToken(auth: Auth, token: string): Promise<void>;
2953
+
2944
2954
  /**
2945
2955
  * An {@link AuthProvider} for SAML.
2946
2956
  *
package/dist/auth.d.ts CHANGED
@@ -888,6 +888,7 @@ declare interface AuthInternal extends Auth {
888
888
  useDeviceLanguage(): void;
889
889
  signOut(): Promise<void>;
890
890
  validatePassword(password: string): Promise<PasswordValidationStatus>;
891
+ revokeAccessToken(token: string): Promise<void>;
891
892
  }
892
893
 
893
894
  declare class AuthPopup {
@@ -3413,6 +3414,16 @@ export declare class RecaptchaVerifier implements ApplicationVerifierInternal {
3413
3414
  */
3414
3415
  export declare function reload(user: User): Promise<void>;
3415
3416
 
3417
+ /**
3418
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
3419
+ *
3420
+ * @param auth - The {@link Auth} instance.
3421
+ * @param token - The Apple OAuth access token.
3422
+ *
3423
+ * @public
3424
+ */
3425
+ export declare function revokeAccessToken(auth: Auth, token: string): Promise<void>;
3426
+
3416
3427
  /**
3417
3428
  * An {@link AuthProvider} for SAML.
3418
3429
  *
@@ -1540,6 +1540,9 @@ async function requestStsToken(auth, refreshToken) {
1540
1540
  expiresIn: response.expires_in,
1541
1541
  refreshToken: response.refresh_token
1542
1542
  };
1543
+ }
1544
+ async function revokeToken(auth, request) {
1545
+ return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts:revokeToken" /* Endpoint.REVOKE_TOKEN */, _addTidIfNecessary(auth, request));
1543
1546
  }
1544
1547
 
1545
1548
  /**
@@ -2809,6 +2812,25 @@ class AuthImpl {
2809
2812
  }
2810
2813
  });
2811
2814
  }
2815
+ /**
2816
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
2817
+ */
2818
+ async revokeAccessToken(token) {
2819
+ if (this.currentUser) {
2820
+ const idToken = await this.currentUser.getIdToken();
2821
+ // Generalize this to accept other providers once supported.
2822
+ const request = {
2823
+ providerId: 'apple.com',
2824
+ tokenType: "ACCESS_TOKEN" /* TokenType.ACCESS_TOKEN */,
2825
+ token,
2826
+ idToken
2827
+ };
2828
+ if (this.tenantId != null) {
2829
+ request.tenantId = this.tenantId;
2830
+ }
2831
+ await revokeToken(this, request);
2832
+ }
2833
+ }
2812
2834
  toJSON() {
2813
2835
  var _a;
2814
2836
  return {
@@ -6518,6 +6540,18 @@ function updateCurrentUser(auth, user) {
6518
6540
  function signOut(auth) {
6519
6541
  return util.getModularInstance(auth).signOut();
6520
6542
  }
6543
+ /**
6544
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
6545
+ *
6546
+ * @param auth - The {@link Auth} instance.
6547
+ * @param token - The Apple OAuth access token.
6548
+ *
6549
+ * @public
6550
+ */
6551
+ function revokeAccessToken(auth, token) {
6552
+ const authInternal = _castAuth(auth);
6553
+ return authInternal.revokeAccessToken(token);
6554
+ }
6521
6555
  /**
6522
6556
  * Deletes and signs out the user.
6523
6557
  *
@@ -10233,7 +10267,7 @@ function _isEmptyString(input) {
10233
10267
  }
10234
10268
 
10235
10269
  var name = "@firebase/auth";
10236
- var version = "1.3.2-canary.ff1a6ec2c";
10270
+ var version = "1.4.0-20231107192534";
10237
10271
 
10238
10272
  /**
10239
10273
  * @license
@@ -10536,6 +10570,7 @@ exports.reauthenticateWithPhoneNumber = reauthenticateWithPhoneNumber;
10536
10570
  exports.reauthenticateWithPopup = reauthenticateWithPopup;
10537
10571
  exports.reauthenticateWithRedirect = reauthenticateWithRedirect;
10538
10572
  exports.reload = reload;
10573
+ exports.revokeAccessToken = revokeAccessToken;
10539
10574
  exports.sendEmailVerification = sendEmailVerification;
10540
10575
  exports.sendPasswordResetEmail = sendPasswordResetEmail;
10541
10576
  exports.sendSignInLinkToEmail = sendSignInLinkToEmail;
@@ -10559,4 +10594,4 @@ exports.useDeviceLanguage = useDeviceLanguage;
10559
10594
  exports.validatePassword = validatePassword;
10560
10595
  exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
10561
10596
  exports.verifyPasswordResetCode = verifyPasswordResetCode;
10562
- //# sourceMappingURL=index-605f94d7.js.map
10597
+ //# sourceMappingURL=index-dfd6ff50.js.map