@react-native-firebase/auth 24.1.1 → 25.0.1

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 (216) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/android/src/main/java/io/invertase/firebase/auth/ReactNativeFirebaseAuthModule.java +16 -4
  3. package/dist/module/ActionCodeURL.js +140 -0
  4. package/dist/module/ActionCodeURL.js.map +1 -0
  5. package/{lib → dist/module}/ConfirmationResult.js +4 -5
  6. package/dist/module/ConfirmationResult.js.map +1 -0
  7. package/{lib → dist/module}/MultiFactorResolver.js +14 -5
  8. package/dist/module/MultiFactorResolver.js.map +1 -0
  9. package/{lib → dist/module}/PhoneAuthListener.js +52 -75
  10. package/dist/module/PhoneAuthListener.js.map +1 -0
  11. package/dist/module/PhoneAuthState.js +25 -0
  12. package/dist/module/PhoneAuthState.js.map +1 -0
  13. package/dist/module/PhoneMultiFactorGenerator.js +39 -0
  14. package/dist/module/PhoneMultiFactorGenerator.js.map +1 -0
  15. package/{lib → dist/module}/Settings.js +3 -7
  16. package/dist/module/Settings.js.map +1 -0
  17. package/{lib → dist/module}/TotpMultiFactorGenerator.js +20 -15
  18. package/dist/module/TotpMultiFactorGenerator.js.map +1 -0
  19. package/{lib → dist/module}/TotpSecret.js +7 -5
  20. package/dist/module/TotpSecret.js.map +1 -0
  21. package/dist/module/User.js +245 -0
  22. package/dist/module/User.js.map +1 -0
  23. package/dist/module/constants.js +54 -0
  24. package/dist/module/constants.js.map +1 -0
  25. package/dist/module/credentials/AuthCredential.js +51 -0
  26. package/dist/module/credentials/AuthCredential.js.map +1 -0
  27. package/dist/module/credentials/EmailAuthCredential.js +51 -0
  28. package/dist/module/credentials/EmailAuthCredential.js.map +1 -0
  29. package/dist/module/credentials/OAuthCredential.js +84 -0
  30. package/dist/module/credentials/OAuthCredential.js.map +1 -0
  31. package/dist/module/credentials/PhoneAuthCredential.js +50 -0
  32. package/dist/module/credentials/PhoneAuthCredential.js.map +1 -0
  33. package/{lib/providers/GoogleAuthProvider.js → dist/module/credentials/index.js} +7 -19
  34. package/dist/module/credentials/index.js.map +1 -0
  35. package/{lib → dist/module}/getMultiFactorResolver.js +5 -8
  36. package/dist/module/getMultiFactorResolver.js.map +1 -0
  37. package/{lib/providers/FacebookAuthProvider.js → dist/module/index.js} +11 -18
  38. package/dist/module/index.js.map +1 -0
  39. package/dist/module/modular.js +793 -0
  40. package/dist/module/modular.js.map +1 -0
  41. package/{lib → dist/module}/multiFactor.js +16 -14
  42. package/dist/module/multiFactor.js.map +1 -0
  43. package/dist/module/namespaced.js +522 -0
  44. package/dist/module/namespaced.js.map +1 -0
  45. package/dist/module/package.json +1 -0
  46. package/dist/module/password-policy/PasswordPolicyImpl.js +103 -0
  47. package/dist/module/password-policy/PasswordPolicyImpl.js.map +1 -0
  48. package/{lib → dist/module}/password-policy/PasswordPolicyMixin.js +14 -16
  49. package/dist/module/password-policy/PasswordPolicyMixin.js.map +1 -0
  50. package/{lib → dist/module}/password-policy/passwordPolicyApi.js +18 -12
  51. package/dist/module/password-policy/passwordPolicyApi.js.map +1 -0
  52. package/{lib → dist/module}/providers/AppleAuthProvider.js +14 -7
  53. package/dist/module/providers/AppleAuthProvider.js.map +1 -0
  54. package/{lib → dist/module}/providers/EmailAuthProvider.js +10 -25
  55. package/dist/module/providers/EmailAuthProvider.js.map +1 -0
  56. package/dist/module/providers/FacebookAuthProvider.js +56 -0
  57. package/dist/module/providers/FacebookAuthProvider.js.map +1 -0
  58. package/dist/module/providers/GithubAuthProvider.js +49 -0
  59. package/dist/module/providers/GithubAuthProvider.js.map +1 -0
  60. package/dist/module/providers/GoogleAuthProvider.js +57 -0
  61. package/dist/module/providers/GoogleAuthProvider.js.map +1 -0
  62. package/dist/module/providers/OAuthProvider.js +116 -0
  63. package/dist/module/providers/OAuthProvider.js.map +1 -0
  64. package/{lib → dist/module}/providers/OIDCAuthProvider.js +15 -7
  65. package/dist/module/providers/OIDCAuthProvider.js.map +1 -0
  66. package/dist/module/providers/PhoneAuthProvider.js +87 -0
  67. package/dist/module/providers/PhoneAuthProvider.js.map +1 -0
  68. package/dist/module/providers/TwitterAuthProvider.js +50 -0
  69. package/dist/module/providers/TwitterAuthProvider.js.map +1 -0
  70. package/dist/module/types/auth.js +43 -0
  71. package/dist/module/types/auth.js.map +1 -0
  72. package/dist/module/types/internal.js +4 -0
  73. package/dist/module/types/internal.js.map +1 -0
  74. package/dist/module/types/namespaced.js +62 -0
  75. package/dist/module/types/namespaced.js.map +1 -0
  76. package/dist/module/version.js +5 -0
  77. package/dist/module/version.js.map +1 -0
  78. package/dist/module/web/RNFBAuthModule.android.js +5 -0
  79. package/dist/module/web/RNFBAuthModule.android.js.map +1 -0
  80. package/dist/module/web/RNFBAuthModule.ios.js +5 -0
  81. package/dist/module/web/RNFBAuthModule.ios.js.map +1 -0
  82. package/{lib → dist/module}/web/RNFBAuthModule.js +104 -321
  83. package/dist/module/web/RNFBAuthModule.js.map +1 -0
  84. package/dist/typescript/lib/ActionCodeURL.d.ts +41 -0
  85. package/dist/typescript/lib/ActionCodeURL.d.ts.map +1 -0
  86. package/dist/typescript/lib/ConfirmationResult.d.ts +10 -0
  87. package/dist/typescript/lib/ConfirmationResult.d.ts.map +1 -0
  88. package/dist/typescript/lib/MultiFactorResolver.d.ts +24 -0
  89. package/dist/typescript/lib/MultiFactorResolver.d.ts.map +1 -0
  90. package/dist/typescript/lib/PhoneAuthListener.d.ts +34 -0
  91. package/dist/typescript/lib/PhoneAuthListener.d.ts.map +1 -0
  92. package/dist/typescript/lib/PhoneAuthState.d.ts +7 -0
  93. package/dist/typescript/lib/PhoneAuthState.d.ts.map +1 -0
  94. package/dist/typescript/lib/PhoneMultiFactorGenerator.d.ts +7 -0
  95. package/dist/typescript/lib/PhoneMultiFactorGenerator.d.ts.map +1 -0
  96. package/dist/typescript/lib/Settings.d.ts +13 -0
  97. package/dist/typescript/lib/Settings.d.ts.map +1 -0
  98. package/dist/typescript/lib/TotpMultiFactorGenerator.d.ts +11 -0
  99. package/dist/typescript/lib/TotpMultiFactorGenerator.d.ts.map +1 -0
  100. package/dist/typescript/lib/TotpSecret.d.ts +33 -0
  101. package/dist/typescript/lib/TotpSecret.d.ts.map +1 -0
  102. package/dist/typescript/lib/User.d.ts +51 -0
  103. package/dist/typescript/lib/User.d.ts.map +1 -0
  104. package/dist/typescript/lib/constants.d.ts +35 -0
  105. package/dist/typescript/lib/constants.d.ts.map +1 -0
  106. package/dist/typescript/lib/credentials/AuthCredential.d.ts +12 -0
  107. package/dist/typescript/lib/credentials/AuthCredential.d.ts.map +1 -0
  108. package/dist/typescript/lib/credentials/EmailAuthCredential.d.ts +8 -0
  109. package/dist/typescript/lib/credentials/EmailAuthCredential.d.ts.map +1 -0
  110. package/dist/typescript/lib/credentials/OAuthCredential.d.ts +22 -0
  111. package/dist/typescript/lib/credentials/OAuthCredential.d.ts.map +1 -0
  112. package/dist/typescript/lib/credentials/PhoneAuthCredential.d.ts +8 -0
  113. package/dist/typescript/lib/credentials/PhoneAuthCredential.d.ts.map +1 -0
  114. package/dist/typescript/lib/credentials/index.d.ts +5 -0
  115. package/dist/typescript/lib/credentials/index.d.ts.map +1 -0
  116. package/dist/typescript/lib/getMultiFactorResolver.d.ts +19 -0
  117. package/dist/typescript/lib/getMultiFactorResolver.d.ts.map +1 -0
  118. package/dist/typescript/lib/index.d.ts +8 -0
  119. package/dist/typescript/lib/index.d.ts.map +1 -0
  120. package/dist/typescript/lib/modular.d.ts +370 -0
  121. package/dist/typescript/lib/modular.d.ts.map +1 -0
  122. package/dist/typescript/lib/multiFactor.d.ts +26 -0
  123. package/dist/typescript/lib/multiFactor.d.ts.map +1 -0
  124. package/dist/typescript/lib/namespaced.d.ts +12 -0
  125. package/dist/typescript/lib/namespaced.d.ts.map +1 -0
  126. package/dist/typescript/lib/password-policy/PasswordPolicyImpl.d.ts +19 -0
  127. package/dist/typescript/lib/password-policy/PasswordPolicyImpl.d.ts.map +1 -0
  128. package/dist/typescript/lib/password-policy/PasswordPolicyMixin.d.ts +11 -0
  129. package/dist/typescript/lib/password-policy/PasswordPolicyMixin.d.ts.map +1 -0
  130. package/dist/typescript/lib/password-policy/passwordPolicyApi.d.ts +10 -0
  131. package/dist/typescript/lib/password-policy/passwordPolicyApi.d.ts.map +1 -0
  132. package/dist/typescript/lib/providers/AppleAuthProvider.d.ts +16 -0
  133. package/dist/typescript/lib/providers/AppleAuthProvider.d.ts.map +1 -0
  134. package/dist/typescript/lib/providers/EmailAuthProvider.d.ts +11 -0
  135. package/dist/typescript/lib/providers/EmailAuthProvider.d.ts.map +1 -0
  136. package/dist/typescript/lib/providers/FacebookAuthProvider.d.ts +19 -0
  137. package/dist/typescript/lib/providers/FacebookAuthProvider.d.ts.map +1 -0
  138. package/dist/typescript/lib/providers/GithubAuthProvider.d.ts +15 -0
  139. package/dist/typescript/lib/providers/GithubAuthProvider.d.ts.map +1 -0
  140. package/dist/typescript/lib/providers/GoogleAuthProvider.d.ts +21 -0
  141. package/dist/typescript/lib/providers/GoogleAuthProvider.d.ts.map +1 -0
  142. package/dist/typescript/lib/providers/OAuthProvider.d.ts +33 -0
  143. package/dist/typescript/lib/providers/OAuthProvider.d.ts.map +1 -0
  144. package/dist/typescript/lib/providers/OIDCAuthProvider.d.ts +16 -0
  145. package/dist/typescript/lib/providers/OIDCAuthProvider.d.ts.map +1 -0
  146. package/dist/typescript/lib/providers/PhoneAuthProvider.d.ts +16 -0
  147. package/dist/typescript/lib/providers/PhoneAuthProvider.d.ts.map +1 -0
  148. package/dist/typescript/lib/providers/TwitterAuthProvider.d.ts +15 -0
  149. package/dist/typescript/lib/providers/TwitterAuthProvider.d.ts.map +1 -0
  150. package/dist/typescript/lib/types/auth.d.ts +305 -0
  151. package/dist/typescript/lib/types/auth.d.ts.map +1 -0
  152. package/dist/typescript/lib/types/internal.d.ts +293 -0
  153. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  154. package/dist/typescript/lib/types/namespaced.d.ts +2185 -0
  155. package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
  156. package/dist/typescript/lib/version.d.ts +2 -0
  157. package/dist/typescript/lib/version.d.ts.map +1 -0
  158. package/dist/typescript/lib/web/RNFBAuthModule.android.d.ts +3 -0
  159. package/dist/typescript/lib/web/RNFBAuthModule.android.d.ts.map +1 -0
  160. package/dist/typescript/lib/web/RNFBAuthModule.d.ts +406 -0
  161. package/dist/typescript/lib/web/RNFBAuthModule.d.ts.map +1 -0
  162. package/dist/typescript/lib/web/RNFBAuthModule.ios.d.ts +3 -0
  163. package/dist/typescript/lib/web/RNFBAuthModule.ios.d.ts.map +1 -0
  164. package/dist/typescript/package.json +1 -0
  165. package/ios/RNFBAuth/RNFBAuthModule.m +4 -2
  166. package/lib/ActionCodeURL.ts +174 -0
  167. package/lib/ConfirmationResult.ts +42 -0
  168. package/lib/MultiFactorResolver.ts +51 -0
  169. package/lib/PhoneAuthListener.ts +312 -0
  170. package/lib/PhoneAuthState.ts +22 -0
  171. package/lib/{PhoneMultiFactorGenerator.js → PhoneMultiFactorGenerator.ts} +8 -2
  172. package/lib/Settings.ts +59 -0
  173. package/lib/TotpMultiFactorGenerator.ts +78 -0
  174. package/lib/TotpSecret.ts +71 -0
  175. package/lib/{User.js → User.ts} +127 -83
  176. package/lib/constants.ts +55 -0
  177. package/lib/credentials/AuthCredential.ts +55 -0
  178. package/lib/credentials/EmailAuthCredential.ts +70 -0
  179. package/lib/credentials/OAuthCredential.ts +113 -0
  180. package/lib/credentials/PhoneAuthCredential.ts +66 -0
  181. package/lib/{providers/GithubAuthProvider.js → credentials/index.ts} +4 -19
  182. package/lib/getMultiFactorResolver.ts +40 -0
  183. package/lib/{providers/TwitterAuthProvider.js → index.ts} +14 -19
  184. package/lib/modular.ts +1172 -0
  185. package/lib/multiFactor.ts +83 -0
  186. package/lib/namespaced.ts +846 -0
  187. package/lib/password-policy/{PasswordPolicyImpl.js → PasswordPolicyImpl.ts} +37 -19
  188. package/lib/password-policy/PasswordPolicyMixin.ts +83 -0
  189. package/lib/password-policy/passwordPolicyApi.ts +60 -0
  190. package/lib/providers/AppleAuthProvider.ts +44 -0
  191. package/lib/providers/EmailAuthProvider.ts +42 -0
  192. package/lib/providers/FacebookAuthProvider.ts +58 -0
  193. package/lib/providers/GithubAuthProvider.ts +51 -0
  194. package/lib/providers/GoogleAuthProvider.ts +60 -0
  195. package/lib/providers/OAuthProvider.ts +150 -0
  196. package/lib/providers/OIDCAuthProvider.ts +49 -0
  197. package/lib/providers/PhoneAuthProvider.ts +161 -0
  198. package/lib/providers/TwitterAuthProvider.ts +52 -0
  199. package/lib/types/auth.ts +393 -0
  200. package/lib/types/internal.ts +475 -0
  201. package/lib/{index.d.ts → types/namespaced.ts} +52 -41
  202. package/lib/version.ts +2 -0
  203. package/lib/web/RNFBAuthModule.ts +1359 -0
  204. package/package.json +41 -9
  205. package/plugin/tsconfig.tsbuildinfo +1 -1
  206. package/tsconfig.json +26 -0
  207. package/tsdoc.json +22 -0
  208. package/typedoc.json +9 -2
  209. package/lib/index.js +0 -572
  210. package/lib/modular/index.d.ts +0 -801
  211. package/lib/modular/index.js +0 -651
  212. package/lib/providers/OAuthProvider.js +0 -70
  213. package/lib/providers/PhoneAuthProvider.js +0 -52
  214. package/lib/version.js +0 -2
  215. /package/lib/web/{RNFBAuthModule.android.js → RNFBAuthModule.android.ts} +0 -0
  216. /package/lib/web/{RNFBAuthModule.ios.js → RNFBAuthModule.ios.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [25.0.1](https://github.com/invertase/react-native-firebase/compare/v25.0.0...v25.0.1) (2026-06-23)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **auth:** export revokeToken in modular API for Sign in with Apple ([a05fa66](https://github.com/invertase/react-native-firebase/commit/a05fa66c44d6043bad72c9d1b3374e305b51edcc)), closes [#9070](https://github.com/invertase/react-native-firebase/issues/9070)
11
+
12
+ ## [25.0.0](https://github.com/invertase/react-native-firebase/compare/v24.0.0...v25.0.0) (2026-06-23)
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ - **auth:** migrate to TypeScript and bring auth closer in alignment with firebase-js-sdk API (#8991)
17
+
18
+ ### Code Refactoring
19
+
20
+ - **auth:** migrate to TypeScript and bring auth closer in alignment with firebase-js-sdk API ([#8991](https://github.com/invertase/react-native-firebase/issues/8991)) ([7cf7c1a](https://github.com/invertase/react-native-firebase/commit/7cf7c1ac0d31d09ade581deb027d4ed8126bb7cf))
21
+
6
22
  ## [24.1.1](https://github.com/invertase/react-native-firebase/compare/v24.1.0...v24.1.1) (2026-06-10)
7
23
 
8
24
  **Note:** Version bump only for package @react-native-firebase/auth
@@ -2056,6 +2056,12 @@ class ReactNativeFirebaseAuthModule extends ReactNativeFirebaseModule {
2056
2056
  .setIdTokenWithRawNonce(authToken, authSecret)
2057
2057
  .build();
2058
2058
  case "oauth":
2059
+ if (authToken == null || authToken.isEmpty()) {
2060
+ return OAuthProvider.newCredentialBuilder(provider).setAccessToken(authSecret).build();
2061
+ }
2062
+ if (authSecret == null || authSecret.isEmpty()) {
2063
+ return OAuthProvider.newCredentialBuilder(provider).setIdToken(authToken).build();
2064
+ }
2059
2065
  return OAuthProvider.getCredential(provider, authToken, authSecret);
2060
2066
  case "phone":
2061
2067
  return getPhoneAuthCredential(authToken, authSecret);
@@ -2251,12 +2257,18 @@ class ReactNativeFirebaseAuthModule extends ReactNativeFirebaseModule {
2251
2257
  *
2252
2258
  * @param appName
2253
2259
  * @param tenantId
2260
+ * @param promise
2254
2261
  */
2255
2262
  @ReactMethod
2256
- public void setTenantId(String appName, String tenantId) {
2257
- FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
2258
- FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp);
2259
- firebaseAuth.setTenantId(tenantId);
2263
+ public void setTenantId(String appName, String tenantId, final Promise promise) {
2264
+ try {
2265
+ FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
2266
+ FirebaseAuth firebaseAuth = FirebaseAuth.getInstance(firebaseApp);
2267
+ firebaseAuth.setTenantId(tenantId);
2268
+ promise.resolve(null);
2269
+ } catch (Exception exception) {
2270
+ promiseRejectAuthException(promise, exception);
2271
+ }
2260
2272
  }
2261
2273
 
2262
2274
  /**
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ import { ActionCodeOperation } from "./constants.js";
21
+ function extractQuerystring(url) {
22
+ const queryIndex = url.indexOf('?');
23
+ if (queryIndex < 0) {
24
+ return '';
25
+ }
26
+ const hashIndex = url.indexOf('#');
27
+ const end = hashIndex > queryIndex ? hashIndex : url.length;
28
+ return url.slice(queryIndex + 1, end);
29
+ }
30
+ function querystringDecode(query) {
31
+ const decoded = {};
32
+ if (!query) {
33
+ return decoded;
34
+ }
35
+ for (const part of query.split('&')) {
36
+ if (!part) {
37
+ continue;
38
+ }
39
+ const separatorIndex = part.indexOf('=');
40
+ const key = decodeURIComponent(separatorIndex >= 0 ? part.slice(0, separatorIndex) : part);
41
+ const value = decodeURIComponent(separatorIndex >= 0 ? part.slice(separatorIndex + 1) : '');
42
+ decoded[key] = value;
43
+ }
44
+ return decoded;
45
+ }
46
+ function parseMode(mode) {
47
+ switch (mode) {
48
+ case 'recoverEmail':
49
+ return ActionCodeOperation.RECOVER_EMAIL;
50
+ case 'resetPassword':
51
+ return ActionCodeOperation.PASSWORD_RESET;
52
+ case 'signIn':
53
+ return ActionCodeOperation.EMAIL_SIGNIN;
54
+ case 'verifyEmail':
55
+ return ActionCodeOperation.VERIFY_EMAIL;
56
+ case 'verifyAndChangeEmail':
57
+ return ActionCodeOperation.VERIFY_AND_CHANGE_EMAIL;
58
+ case 'revertSecondFactorAddition':
59
+ return ActionCodeOperation.REVERT_SECOND_FACTOR_ADDITION;
60
+ default:
61
+ return null;
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Parses Firebase dynamic-link style wrappers and returns the inner action link URL.
67
+ *
68
+ * Ported from firebase-js-sdk `parseDeepLink` (pure URL parsing; no native bridge).
69
+ */
70
+ function parseDeepLink(url) {
71
+ const link = querystringDecode(extractQuerystring(url)).link;
72
+ const doubleDeepLink = link ? querystringDecode(extractQuerystring(link)).deep_link_id : null;
73
+ const iOSDeepLink = querystringDecode(extractQuerystring(url)).deep_link_id;
74
+ const iOSDoubleDeepLink = iOSDeepLink ? querystringDecode(extractQuerystring(iOSDeepLink)).link : null;
75
+ return iOSDoubleDeepLink || iOSDeepLink || doubleDeepLink || link || url;
76
+ }
77
+
78
+ /**
79
+ * A structure to help parse out the different components involved in an action link URL.
80
+ *
81
+ * @public
82
+ */
83
+ export class ActionCodeURL {
84
+ /**
85
+ * The API key of the email action link.
86
+ */
87
+
88
+ /**
89
+ * The action code of the email action link.
90
+ */
91
+
92
+ /**
93
+ * The continue URL of the email action link. Null if not provided.
94
+ */
95
+
96
+ /**
97
+ * The language code of the email action link. Null if not provided.
98
+ */
99
+
100
+ /**
101
+ * The action performed by the email action link.
102
+ */
103
+
104
+ /**
105
+ * The tenant ID of the email action link. Null if the email action is from the parent project.
106
+ */
107
+
108
+ constructor(apiKey, code, continueUrl, languageCode, operation, tenantId) {
109
+ this.apiKey = apiKey;
110
+ this.code = code;
111
+ this.continueUrl = continueUrl;
112
+ this.languageCode = languageCode;
113
+ this.operation = operation;
114
+ this.tenantId = tenantId;
115
+ }
116
+
117
+ /**
118
+ * Parses the email action link string and returns an {@link ActionCodeURL} if the link is valid,
119
+ * otherwise returns null.
120
+ *
121
+ * @param link - The email action link string.
122
+ * @returns The {@link ActionCodeURL} object, or null if the link is invalid.
123
+ */
124
+ static parseLink(link) {
125
+ const actionLink = parseDeepLink(link);
126
+ try {
127
+ const searchParams = querystringDecode(extractQuerystring(actionLink));
128
+ const apiKey = searchParams.apiKey ?? null;
129
+ const code = searchParams.oobCode ?? null;
130
+ const operation = parseMode(searchParams.mode ?? null);
131
+ if (!apiKey || !code || !operation) {
132
+ return null;
133
+ }
134
+ return new ActionCodeURL(apiKey, code, searchParams.continueUrl ?? null, searchParams.lang ?? null, operation, searchParams.tenantId ?? null);
135
+ } catch {
136
+ return null;
137
+ }
138
+ }
139
+ }
140
+ //# sourceMappingURL=ActionCodeURL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ActionCodeOperation","extractQuerystring","url","queryIndex","indexOf","hashIndex","end","length","slice","querystringDecode","query","decoded","part","split","separatorIndex","key","decodeURIComponent","value","parseMode","mode","RECOVER_EMAIL","PASSWORD_RESET","EMAIL_SIGNIN","VERIFY_EMAIL","VERIFY_AND_CHANGE_EMAIL","REVERT_SECOND_FACTOR_ADDITION","parseDeepLink","link","doubleDeepLink","deep_link_id","iOSDeepLink","iOSDoubleDeepLink","ActionCodeURL","constructor","apiKey","code","continueUrl","languageCode","operation","tenantId","parseLink","actionLink","searchParams","oobCode","lang"],"sourceRoot":"../../lib","sources":["ActionCodeURL.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,gBAAa;AAEjD,SAASC,kBAAkBA,CAACC,GAAW,EAAU;EAC/C,MAAMC,UAAU,GAAGD,GAAG,CAACE,OAAO,CAAC,GAAG,CAAC;EACnC,IAAID,UAAU,GAAG,CAAC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wB;IACnD,MAAMc,UAAU,GAAGf,aAAa,CAACC,IAAI,CAAC;IAEtC,IAAI;MACF,MAAMe,YAAY,GAAGjC,iBAAiB,CAACR,kBAAkB,CAACwC,UAAU,CAAC,CAAC;MACtE,MAAMP,MAAM,GAAGQ,YAAY,CAACR,MAAM,IAAI,IAAI;MAC1C,MAAMC,IAAI,GAAGO,YAAY,CAACC,OAAO,IAAI,IAAI;MACzC,MAAML,SAAS,GAAGpB,SAAS,CAACwB,YAAY,CAACvB,IAAI,IAAI,IAAI,CAAC;MAEtD,IAAI,CAACe,MAAM,IAAI,CAACC,IAAI,IAAI,CAACG,SAAS,EAAE;QAClC,OAAO,IAAI;MACb;MAEA,OAAO,IAAIN,aAAa,CACtBE,MAAM,EACNC,IAAI,EACJO,YAAY,CAACN,WAAW,IAAI,IAAI,EAChCM,YAAY,CAACE,IAAI,IAAI,IAAI,EACzBN,SAAS,EACTI,YAAY,CAACH,QAAQ,IAAI,IAC3B,CAAC;IACH,CAAC,CAAC,MAAM;MACN,OAAO,IAAI;IACb;EACF;AACF","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  /*
2
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
5
  *
@@ -20,14 +22,11 @@ export default class ConfirmationResult {
20
22
  this._auth = auth;
21
23
  this._verificationId = verificationId;
22
24
  }
23
-
24
25
  confirm(verificationCode) {
25
- return this._auth.native
26
- .confirmationResultConfirm(verificationCode)
27
- .then(userCredential => this._auth._setUserCredential(userCredential));
26
+ return this._auth.native.confirmationResultConfirm(verificationCode).then(userCredential => this._auth._setUserCredential(userCredential));
28
27
  }
29
-
30
28
  get verificationId() {
31
29
  return this._verificationId;
32
30
  }
33
31
  }
32
+ //# sourceMappingURL=ConfirmationResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ConfirmationResult","constructor","auth","verificationId","_auth","_verificationId","confirm","verificationCode","native","confirmationResultConfirm","then","userCredential","_setUserCredential"],"sourceRoot":"../../lib","sources":["ConfirmationResult.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,eAAe,MAAMA,kBAAkB,CAAC;EAItCC,WAAWA,CAACC,IAAkB,EAAEC,cAAsB,EAAE;IACtD,IAAI,CAACC,KAAK,GAAGF,IAAI;IACjB,IAAI,CAACG,eAAe,GAAGF,cAAc;EACvC;EAEAG,OAAOA,CAACC,gBAAwB,EAAoD;IAClF,OAAO,IAAI,CAACH,KAAK,CAACI,MAAM,CACrBC,yBAAyB,CAACF,gBAAgB,CAAC,CAC3CG,IAAI,CACHC,cAAc,IACZ,IAAI,CAACP,KAAK,CAACQ,kBAAkB,CAACD,cAAc,CAChD,CAAC;EACL;EAEA,IAAIR,cAAcA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACE,eAAe;EAC7B;AACF","ignoreList":[]}
@@ -1,20 +1,29 @@
1
+ "use strict";
2
+
1
3
  /**
2
4
  * Base class to facilitate multi-factor authentication.
3
5
  */
6
+
4
7
  export default class MultiFactorResolver {
5
8
  constructor(auth, resolver) {
6
9
  this._auth = auth;
7
10
  this.hints = resolver.hints;
8
11
  this.session = resolver.session;
9
12
  }
10
-
11
13
  resolveSignIn(assertion) {
12
- const { token, secret, uid, verificationCode } = assertion;
13
-
14
+ const {
15
+ token,
16
+ secret,
17
+ uid,
18
+ verificationCode
19
+ } = assertion;
14
20
  if (token && secret) {
15
21
  return this._auth.resolveMultiFactorSignIn(this.session, token, secret);
16
22
  }
17
-
18
- return this._auth.resolveTotpSignIn(this.session, uid, verificationCode);
23
+ if (uid && verificationCode) {
24
+ return this._auth.resolveTotpSignIn(this.session, uid, verificationCode);
25
+ }
26
+ throw new Error('Invalid multi-factor assertion provided for sign-in resolution.');
19
27
  }
20
28
  }
29
+ //# sourceMappingURL=MultiFactorResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MultiFactorResolver","constructor","auth","resolver","_auth","hints","session","resolveSignIn","assertion","token","secret","uid","verificationCode","resolveMultiFactorSignIn","resolveTotpSignIn","Error"],"sourceRoot":"../../lib","sources":["MultiFactorResolver.ts"],"mappings":";;AAAA;AACA;AACA;;AAgBA,eAAe,MAAMA,mBAAmB,CAAC;EAKvCC,WAAWA,CAACC,IAAkB,EAAEC,QAAsB,EAAE;IACtD,IAAI,CAACC,KAAK,GAAGF,IAAI;IACjB,IAAI,CAACG,KAAK,GAAGF,QAAQ,CAACE,KAAK;IAC3B,IAAI,CAACC,OAAO,GAAGH,QAAQ,CAACG,OAAO;EACjC;EAEAC,aAAaA,CAACC,SAAoC,EAA6C;IAC7F,MAAM;MAAEC,KAAK;MAAEC,MAAM;MAAEC,GAAG;MAAEC;IAAiB,CAAC,GAAGJ,SAAS;IAE1D,IAAIC,KAAK,IAAIC,MAAM,EAAE;MACnB,OAAO,IAAI,CAACN,KAAK,CAACS,wBAAwB,CACxC,IAAI,CAACP,OAAO,EACZG,KAAK,EACLC,MACF,CAAC;IACH;IAEA,IAAIC,GAAG,IAAIC,gBAAgB,EAAE;MAC3B,OAAO,IAAI,CAACR,KAAK,CAACU,iBAAiB,CACjC,IAAI,CAACR,OAAO,EACZK,GAAG,EACHC,gBACF,CAAC;IACH;IAEA,MAAM,IAAIG,KAAK,CAAC,iEAAiE,CAAC;EACpF;AACF","ignoreList":[]}
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+
1
3
  /*
2
4
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
5
  *
@@ -15,24 +17,16 @@
15
17
  *
16
18
  */
17
19
 
18
- import {
19
- isAndroid,
20
- isFunction,
21
- isIOS,
22
- promiseDefer,
23
- } from '@react-native-firebase/app/dist/module/common';
20
+ import { isAndroid, isFunction, isIOS, promiseDefer } from '@react-native-firebase/app/dist/module/common';
24
21
  import NativeFirebaseError from '@react-native-firebase/app/dist/module/internal/NativeFirebaseError';
25
-
26
22
  let REQUEST_ID = 0;
27
-
28
23
  export default class PhoneAuthListener {
29
24
  constructor(auth, phoneNumber, timeout, forceResend) {
30
25
  this._auth = auth;
31
26
  this._reject = null;
32
27
  this._resolve = null;
33
28
  this._promise = null;
34
- this._jsStack = new Error().stack;
35
-
29
+ this._jsStack = new Error().stack ?? '';
36
30
  this._timeout = timeout || 20;
37
31
  this._phoneAuthRequestId = REQUEST_ID++;
38
32
  this._forceResending = forceResend || false;
@@ -42,67 +36,71 @@ export default class PhoneAuthListener {
42
36
  codeSent: `phone:auth:${this._phoneAuthRequestId}:onCodeSent`,
43
37
  verificationFailed: `phone:auth:${this._phoneAuthRequestId}:onVerificationFailed`,
44
38
  verificationComplete: `phone:auth:${this._phoneAuthRequestId}:onVerificationComplete`,
45
- codeAutoRetrievalTimeout: `phone:auth:${this._phoneAuthRequestId}:onCodeAutoRetrievalTimeout`,
39
+ codeAutoRetrievalTimeout: `phone:auth:${this._phoneAuthRequestId}:onCodeAutoRetrievalTimeout`
46
40
  };
47
41
 
48
42
  // user observer events
49
43
  this._publicEvents = {
50
44
  error: `phone:auth:${this._phoneAuthRequestId}:error`,
51
45
  event: `phone:auth:${this._phoneAuthRequestId}:event`,
52
- success: `phone:auth:${this._phoneAuthRequestId}:success`,
46
+ success: `phone:auth:${this._phoneAuthRequestId}:success`
53
47
  };
54
-
55
48
  this._subscribeToEvents();
56
-
57
49
  if (isAndroid) {
58
- this._auth.native.verifyPhoneNumber(
59
- phoneNumber,
60
- this._phoneAuthRequestId + '',
61
- this._timeout,
62
- this._forceResending,
63
- );
50
+ this._auth.native.verifyPhoneNumber(phoneNumber, this._phoneAuthRequestId + '', this._timeout, this._forceResending);
64
51
  }
65
-
66
52
  if (isIOS) {
67
53
  this._auth.native.verifyPhoneNumber(phoneNumber, this._phoneAuthRequestId + '');
68
54
  }
69
55
  }
70
-
71
56
  _subscribeToEvents() {
72
- const events = Object.keys(this._internalEvents);
73
-
74
- for (let i = 0, len = events.length; i < len; i++) {
75
- const type = events[i];
57
+ const events = ['codeSent', 'verificationFailed', 'verificationComplete', 'codeAutoRetrievalTimeout'];
58
+ for (const type of events) {
76
59
  const subscription = this._auth.emitter.addListener(this._internalEvents[type], event => {
77
- this[`_${type}Handler`](event);
60
+ switch (type) {
61
+ case 'codeSent':
62
+ this._codeSentHandler(event);
63
+ break;
64
+ case 'verificationFailed':
65
+ this._verificationFailedHandler(event);
66
+ break;
67
+ case 'verificationComplete':
68
+ this._verificationCompleteHandler(event);
69
+ break;
70
+ case 'codeAutoRetrievalTimeout':
71
+ this._codeAutoRetrievalTimeoutHandler(event);
72
+ break;
73
+ }
78
74
  subscription.remove();
79
75
  });
80
76
  }
81
77
  }
82
-
83
78
  _addUserObserver(observer) {
84
79
  this._auth.emitter.addListener(this._publicEvents.event, observer);
85
80
  }
86
-
87
81
  _emitToObservers(snapshot) {
88
82
  this._auth.emitter.emit(this._publicEvents.event, snapshot);
89
83
  }
90
-
91
84
  _emitToErrorCb(snapshot) {
92
- const { error } = snapshot;
93
- if (this._reject) {
85
+ const {
86
+ error
87
+ } = snapshot;
88
+ if (this._reject && error) {
94
89
  this._reject(error);
95
90
  }
96
- this._auth.emitter.emit(this._publicEvents.error, error);
91
+ this._auth.emitter.emit(this._publicEvents.error, {
92
+ code: error?.code ?? null,
93
+ verificationId: snapshot.verificationId,
94
+ message: error?.message ?? null,
95
+ stack: error?.stack ?? null
96
+ });
97
97
  }
98
-
99
98
  _emitToSuccessCb(snapshot) {
100
99
  if (this._resolve) {
101
100
  this._resolve(snapshot);
102
101
  }
103
102
  this._auth.emitter.emit(this._publicEvents.success, snapshot);
104
103
  }
105
-
106
104
  _removeAllListeners() {
107
105
  setTimeout(() => {
108
106
  // move to next event loop - not sure if needed
@@ -117,10 +115,13 @@ export default class PhoneAuthListener {
117
115
  });
118
116
  }, 0);
119
117
  }
120
-
121
118
  _promiseDeferred() {
122
119
  if (!this._promise) {
123
- const { promise, resolve, reject } = promiseDefer();
120
+ const {
121
+ promise,
122
+ resolve,
123
+ reject
124
+ } = promiseDefer();
124
125
  this._promise = promise;
125
126
  this._resolve = resolve;
126
127
  this._reject = reject;
@@ -136,56 +137,48 @@ export default class PhoneAuthListener {
136
137
  verificationId: credential.verificationId,
137
138
  code: null,
138
139
  error: null,
139
- state: 'sent',
140
+ state: 'sent'
140
141
  };
141
-
142
142
  this._emitToObservers(snapshot);
143
-
144
143
  if (isIOS) {
145
144
  this._emitToSuccessCb(snapshot);
146
145
  }
147
-
148
146
  if (isAndroid) {
149
147
  // android can auto retrieve so we don't emit to successCb immediately,
150
148
  // if auto retrieve times out then that will emit to successCb
151
149
  }
152
150
  }
153
-
154
151
  _codeAutoRetrievalTimeoutHandler(credential) {
155
152
  const snapshot = {
156
153
  verificationId: credential.verificationId,
157
154
  code: null,
158
155
  error: null,
159
- state: 'timeout',
156
+ state: 'timeout'
160
157
  };
161
-
162
158
  this._emitToObservers(snapshot);
163
159
  this._emitToSuccessCb(snapshot);
164
160
  }
165
-
166
161
  _verificationCompleteHandler(credential) {
167
162
  const snapshot = {
168
163
  verificationId: credential.verificationId,
169
164
  code: credential.code || null,
170
165
  error: null,
171
- state: 'verified',
166
+ state: 'verified'
172
167
  };
173
-
174
168
  this._emitToObservers(snapshot);
175
169
  this._emitToSuccessCb(snapshot);
176
170
  this._removeAllListeners();
177
171
  }
178
-
179
172
  _verificationFailedHandler(state) {
180
173
  const snapshot = {
181
174
  verificationId: state.verificationId,
182
175
  code: null,
183
176
  error: null,
184
- state: 'error',
177
+ state: 'error'
185
178
  };
186
-
187
- snapshot.error = new NativeFirebaseError({ userInfo: state.error }, this._jsStack, 'auth');
188
-
179
+ snapshot.error = new NativeFirebaseError({
180
+ userInfo: state.error
181
+ }, this._jsStack, 'auth');
189
182
  this._emitToObservers(snapshot);
190
183
  this._emitToErrorCb(snapshot);
191
184
  this._removeAllListeners();
@@ -197,49 +190,33 @@ export default class PhoneAuthListener {
197
190
 
198
191
  on(event, observer, errorCb, successCb) {
199
192
  if (event !== 'state_changed') {
200
- throw new Error(
201
- "firebase.auth.PhoneAuthListener.on(*, _, _, _) 'event' must equal 'state_changed'.",
202
- );
193
+ throw new Error("firebase.auth.PhoneAuthListener.on(*, _, _, _) 'event' must equal 'state_changed'.");
203
194
  }
204
-
205
195
  if (!isFunction(observer)) {
206
- throw new Error(
207
- "firebase.auth.PhoneAuthListener.on(_, *, _, _) 'observer' must be a function.",
208
- );
196
+ throw new Error("firebase.auth.PhoneAuthListener.on(_, *, _, _) 'observer' must be a function.");
209
197
  }
210
-
211
198
  this._addUserObserver(observer);
212
-
213
199
  if (isFunction(errorCb)) {
214
200
  const subscription = this._auth.emitter.addListener(this._publicEvents.error, event => {
215
201
  subscription.remove();
216
202
  errorCb(event);
217
203
  });
218
204
  }
219
-
220
205
  if (isFunction(successCb)) {
221
206
  const subscription = this._auth.emitter.addListener(this._publicEvents.success, event => {
222
207
  subscription.remove();
223
208
  successCb(event);
224
209
  });
225
210
  }
226
-
227
211
  return this;
228
212
  }
229
-
230
- then(fn) {
213
+ then(onFulfilled, onRejected) {
231
214
  this._promiseDeferred();
232
- if (this._promise) {
233
- return this._promise.then.bind(this._promise)(fn);
234
- }
235
- return undefined;
215
+ return this._promise.then(onFulfilled ?? undefined, onRejected ?? undefined);
236
216
  }
237
-
238
- catch(fn) {
217
+ catch(onRejected) {
239
218
  this._promiseDeferred();
240
- if (this._promise) {
241
- return this._promise.catch.bind(this._promise)(fn);
242
- }
243
- return undefined;
219
+ return this._promise.catch(onRejected ?? undefined);
244
220
  }
245
221
  }
222
+ //# sourceMappingURL=PhoneAuthListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isAndroid","isFunction","isIOS","promiseDefer","NativeFirebaseError","REQUEST_ID","PhoneAuthListener","constructor","auth","phoneNumber","timeout","forceResend","_auth","_reject","_resolve","_promise","_jsStack","Error","stack","_timeout","_phoneAuthRequestId","_forceResending","_internalEvents","codeSent","verificationFailed","verificationComplete","codeAutoRetrievalTimeout","_publicEvents","error","event","success","_subscribeToEvents","native","verifyPhoneNumber","events","type","subscription","emitter","addListener","_codeSentHandler","_verificationFailedHandler","_verificationCompleteHandler","_codeAutoRetrievalTimeoutHandler","remove","_addUserObserver","observer","_emitToObservers","snapshot","emit","_emitToErrorCb","code","verificationId","message","_emitToSuccessCb","_removeAllListeners","setTimeout","Object","values","forEach","removeAllListeners","publicEvent","_promiseDeferred","promise","resolve","reject","credential","state","userInfo","on","errorCb","successCb","then","onFulfilled","onRejected","undefined","catch"],"sourceRoot":"../../lib","sources":["PhoneAuthListener.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,SAAS,EACTC,UAAU,EACVC,KAAK,EACLC,YAAY,QACP,+CAA+C;AAEtD,OAAOC,mBAAmB,MAAM,qEAAqE;AAmBrG,IAAIC,UAAU,GAAG,CAAC;AAElB,eAAe,MAAMC,iBAAiB,CAAC;EAYrCC,WAAWA,CAACC,IAAkB,EAAEC,WAAmB,EAAEC,OAAgB,EAAEC,WAAqB,EAAE;IAC5F,IAAI,CAACC,KAAK,GAAGJ,IAAI;IACjB,IAAI,CAACK,OAAO,GAAG,IAAI;IACnB,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,QAAQ,GAAG,IAAIC,KAAK,CAAC,CAAC,CAACC,KAAK,IAAI,EAAE;IAEvC,IAAI,CAACC,QAAQ,GAAGT,OAAO,IAAI,EAAE;IAC7B,IAAI,CAACU,mBAAmB,GAAGf,UAAU,EAAE;IACvC,IAAI,CAACgB,eAAe,GAAGV,WAAW,IAAI,KAAK;;IAE3C;IACA,IAAI,CAACW,eAAe,GAAG;MACrBC,QAAQ,EAAE,cAAc,IAAI,CAACH,mBAAmB,aAAa;MAC7DI,kBAAkB,EAAE,cAAc,IAAI,CAACJ,mBAAmB,uBAAuB;MACjFK,oBAAoB,EAAE,cAAc,IAAI,CAACL,mBAAmB,yBAAy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C,QAAQ,CAAC;IAE/B,IAAI5C,UAAU,CAACoE,OAAO,CAAC,EAAE;MACvB,MAAMjC,YAAY,GAAG,IAAI,CAACxB,KAAK,CAACyB,OAAO,CAACC,WAAW,CAAC,IAAI,CAACX,aAAa,CAACC,KAAK,EAAEC,KAAK,IAAI;QACrFO,YAAY,CAACO,MAAM,CAAC,CAAC;QACrB0B,OAAO,CAACxC,KAAuB,CAAC;MAClC,CAAC,CAAC;IACJ;IAEA,IAAI5B,UAAU,CAACqE,SAAS,CAAC,EAAE;MACzB,MAAMlC,YAAY,GAAG,IAAI,CAACxB,KAAK,CAACyB,OAAO,CAACC,WAAW,CAAC,IAAI,CAACX,aAAa,CAACG,OAAO,EAAED,KAAK,IAAI;QACvFO,YAAY,CAACO,MAAM,CAAC,CAAC;QACrB2B,SAAS,CAACzC,KAA0B,CAAC;MACvC,CAAC,CAAC;IACJ;IAEA,OAAO,IAAI;EACb;EAEA0C,IAAIA,CACFC,WAAqF,EACrFC,UAEQ,EACsB;IAC9B,IAAI,CAACZ,gBAAgB,CAAC,CAAC;IACvB,OAAO,IAAI,CAAC9C,QAAQ,CAAEwD,IAAI,CAACC,WAAW,IAAIE,SAAS,EAAED,UAAU,IAAIC,SAAS,CAAC;EAC/E;EAEAC,KAAKA,CACHF,UAEQ,EAC8B;IACtC,IAAI,CAACZ,gBAAgB,CAAC,CAAC;IACvB,OAAO,IAAI,CAAC9C,QAAQ,CAAE4D,KAAK,CAACF,UAAU,IAAIC,SAAS,CAAC;EACtD;AACF","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ export const PhoneAuthState = {
20
+ CODE_SENT: 'sent',
21
+ AUTO_VERIFY_TIMEOUT: 'timeout',
22
+ AUTO_VERIFIED: 'verified',
23
+ ERROR: 'error'
24
+ };
25
+ //# sourceMappingURL=PhoneAuthState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PhoneAuthState","CODE_SENT","AUTO_VERIFY_TIMEOUT","AUTO_VERIFIED","ERROR"],"sourceRoot":"../../lib","sources":["PhoneAuthState.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,cAAc,GAAG;EAC5BC,SAAS,EAAE,MAAM;EACjBC,mBAAmB,EAAE,SAAS;EAC9BC,aAAa,EAAE,UAAU;EACzBC,KAAK,EAAE;AACT,CAAU","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ /*
4
+ * Copyright (c) 2016-present Invertase Limited & Contributors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this library except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ *
18
+ */
19
+
20
+ export default class PhoneMultiFactorGenerator {
21
+ static FACTOR_ID = 'phone';
22
+ constructor() {
23
+ throw new Error('`new PhoneMultiFactorGenerator()` is not supported on the native Firebase SDKs.');
24
+ }
25
+ static assertion(credential) {
26
+ // There is no logic here, we mainly do this for API compatibility
27
+ // (following the Web API).
28
+ const {
29
+ token,
30
+ secret
31
+ } = credential;
32
+ return {
33
+ token,
34
+ secret,
35
+ factorId: 'phone'
36
+ };
37
+ }
38
+ }
39
+ //# sourceMappingURL=PhoneMultiFactorGenerator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PhoneMultiFactorGenerator","FACTOR_ID","constructor","Error","assertion","credential","token","secret","factorId"],"sourceRoot":"../../lib","sources":["PhoneMultiFactorGenerator.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,eAAe,MAAMA,yBAAyB,CAAC;EAC7C,OAAOC,SAAS,GAAG,OAAO;EAE1BC,WAAWA,CAAA,EAAG;IACZ,MAAM,IAAIC,KAAK,CACb,iFACF,CAAC;EACH;EAEA,OAAOC,SAASA,CAACC,UAA+B,EAA6B;IAC3E;IACA;IACA,MAAM;MAAEC,KAAK;MAAEC;IAAO,CAAC,GAAGF,UAAU;IACpC,OAAO;MACLC,KAAK;MACLC,MAAM;MACNC,QAAQ,EAAE;IACZ,CAAC;EACH;AACF","ignoreList":[]}