@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
@@ -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
  }
@@ -1727,6 +1727,13 @@ function requestStsToken(auth, refreshToken) {
1727
1727
  }
1728
1728
  });
1729
1729
  });
1730
+ }
1731
+ function revokeToken(auth, request) {
1732
+ return tslib.__awaiter(this, void 0, void 0, function () {
1733
+ return tslib.__generator(this, function (_a) {
1734
+ return [2 /*return*/, _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts:revokeToken" /* Endpoint.REVOKE_TOKEN */, _addTidIfNecessary(auth, request))];
1735
+ });
1736
+ });
1730
1737
  }
1731
1738
 
1732
1739
  /**
@@ -3324,6 +3331,37 @@ var AuthImpl = /** @class */ (function () {
3324
3331
  }
3325
3332
  });
3326
3333
  };
3334
+ /**
3335
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
3336
+ */
3337
+ AuthImpl.prototype.revokeAccessToken = function (token) {
3338
+ return tslib.__awaiter(this, void 0, void 0, function () {
3339
+ var idToken, request;
3340
+ return tslib.__generator(this, function (_a) {
3341
+ switch (_a.label) {
3342
+ case 0:
3343
+ if (!this.currentUser) return [3 /*break*/, 3];
3344
+ return [4 /*yield*/, this.currentUser.getIdToken()];
3345
+ case 1:
3346
+ idToken = _a.sent();
3347
+ request = {
3348
+ providerId: 'apple.com',
3349
+ tokenType: "ACCESS_TOKEN" /* TokenType.ACCESS_TOKEN */,
3350
+ token: token,
3351
+ idToken: idToken
3352
+ };
3353
+ if (this.tenantId != null) {
3354
+ request.tenantId = this.tenantId;
3355
+ }
3356
+ return [4 /*yield*/, revokeToken(this, request)];
3357
+ case 2:
3358
+ _a.sent();
3359
+ _a.label = 3;
3360
+ case 3: return [2 /*return*/];
3361
+ }
3362
+ });
3363
+ });
3364
+ };
3327
3365
  AuthImpl.prototype.toJSON = function () {
3328
3366
  var _a;
3329
3367
  return {
@@ -7646,6 +7684,18 @@ function updateCurrentUser(auth, user) {
7646
7684
  function signOut(auth) {
7647
7685
  return util.getModularInstance(auth).signOut();
7648
7686
  }
7687
+ /**
7688
+ * Revokes the given access token. Currently only supports Apple OAuth access tokens.
7689
+ *
7690
+ * @param auth - The {@link Auth} instance.
7691
+ * @param token - The Apple OAuth access token.
7692
+ *
7693
+ * @public
7694
+ */
7695
+ function revokeAccessToken(auth, token) {
7696
+ var authInternal = _castAuth(auth);
7697
+ return authInternal.revokeAccessToken(token);
7698
+ }
7649
7699
  /**
7650
7700
  * Deletes and signs out the user.
7651
7701
  *
@@ -7969,7 +8019,7 @@ function multiFactor(user) {
7969
8019
  }
7970
8020
 
7971
8021
  var name = "@firebase/auth";
7972
- var version = "1.3.2-canary.ff1a6ec2c";
8022
+ var version = "1.4.0-20231107192534";
7973
8023
 
7974
8024
  /**
7975
8025
  * @license
@@ -8516,6 +8566,7 @@ exports.reauthenticateWithPhoneNumber = reauthenticateWithPhoneNumber;
8516
8566
  exports.reauthenticateWithPopup = reauthenticateWithPopup;
8517
8567
  exports.reauthenticateWithRedirect = reauthenticateWithRedirect;
8518
8568
  exports.reload = reload;
8569
+ exports.revokeAccessToken = revokeAccessToken;
8519
8570
  exports.sendEmailVerification = sendEmailVerification;
8520
8571
  exports.sendPasswordResetEmail = sendPasswordResetEmail;
8521
8572
  exports.sendSignInLinkToEmail = sendSignInLinkToEmail;
@@ -8540,4 +8591,4 @@ exports.useDeviceLanguage = useDeviceLanguage;
8540
8591
  exports.validatePassword = validatePassword;
8541
8592
  exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
8542
8593
  exports.verifyPasswordResetCode = verifyPasswordResetCode;
8543
- //# sourceMappingURL=totp-53cf7541.js.map
8594
+ //# sourceMappingURL=totp-e17814fd.js.map