@react-native-firebase/auth 24.1.1 → 25.0.0

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 +10 -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 +779 -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 +360 -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 +292 -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 +1158 -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 +474 -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
@@ -0,0 +1,113 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import { AuthCredential, parseCredentialJSON } from './AuthCredential';
19
+
20
+ type OAuthCredentialJSON = {
21
+ providerId?: string;
22
+ signInMethod?: string;
23
+ idToken?: string;
24
+ accessToken?: string;
25
+ rawNonce?: string;
26
+ nonce?: string;
27
+ secret?: string;
28
+ };
29
+
30
+ type OAuthCredentialParams = {
31
+ idToken?: string;
32
+ accessToken?: string;
33
+ rawNonce?: string;
34
+ secret?: string;
35
+ /** @internal RNFB native bridge token slot override */
36
+ bridgeToken?: string;
37
+ /** @internal RNFB native bridge secret slot override */
38
+ bridgeSecret?: string;
39
+ };
40
+
41
+ function resolveOAuthBridgeFields(params: OAuthCredentialParams): { token: string; secret: string } {
42
+ if (params.bridgeToken !== undefined || params.bridgeSecret !== undefined) {
43
+ return {
44
+ token: params.bridgeToken ?? '',
45
+ secret: params.bridgeSecret ?? '',
46
+ };
47
+ }
48
+
49
+ if (params.idToken) {
50
+ return {
51
+ token: params.idToken,
52
+ secret: params.rawNonce ?? params.secret ?? params.accessToken ?? '',
53
+ };
54
+ }
55
+
56
+ if (params.accessToken) {
57
+ // OAuthProvider access-token-only credentials use the secret bridge slot.
58
+ return {
59
+ token: '',
60
+ secret: params.accessToken,
61
+ };
62
+ }
63
+
64
+ return {
65
+ token: params.secret ?? '',
66
+ secret: params.rawNonce ?? '',
67
+ };
68
+ }
69
+
70
+ export class OAuthCredential extends AuthCredential {
71
+ readonly idToken?: string;
72
+ readonly accessToken?: string;
73
+ /** @remarks Used for Sign in with Apple and Facebook limited-login flows. OAuth 1.0 token secrets (e.g. Twitter) use the inherited AuthCredential secret bridge field instead. */
74
+ readonly rawNonce?: string;
75
+
76
+ constructor(providerId: string, params: OAuthCredentialParams) {
77
+ const bridge = resolveOAuthBridgeFields(params);
78
+ super(providerId, providerId, bridge.token, bridge.secret);
79
+ this.idToken = params.idToken;
80
+ this.accessToken = params.accessToken;
81
+ this.rawNonce = params.rawNonce;
82
+ }
83
+
84
+ toJSON(): object {
85
+ const json: Record<string, unknown> = {
86
+ providerId: this.providerId,
87
+ signInMethod: this.signInMethod,
88
+ idToken: this.idToken,
89
+ accessToken: this.accessToken,
90
+ rawNonce: this.rawNonce,
91
+ nonce: this.rawNonce,
92
+ };
93
+ // Twitter (and similar) store the token secret in the native bridge secret slot, not rawNonce.
94
+ if (this.secret && !this.rawNonce) {
95
+ json.secret = this.secret;
96
+ }
97
+ return json;
98
+ }
99
+
100
+ static fromJSON(json: object | string): OAuthCredential | null {
101
+ const parsed = parseCredentialJSON(json) as OAuthCredentialJSON | null;
102
+ if (!parsed || typeof parsed.providerId !== 'string') {
103
+ return null;
104
+ }
105
+
106
+ return new OAuthCredential(parsed.providerId, {
107
+ idToken: parsed.idToken,
108
+ accessToken: parsed.accessToken,
109
+ rawNonce: parsed.rawNonce ?? parsed.nonce,
110
+ secret: parsed.secret,
111
+ });
112
+ }
113
+ }
@@ -0,0 +1,66 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+
18
+ import { AuthCredential, parseCredentialJSON } from './AuthCredential';
19
+
20
+ const providerId = 'phone' as const;
21
+
22
+ type PhoneCredentialJSON = {
23
+ providerId?: string;
24
+ signInMethod?: string;
25
+ verificationId?: string;
26
+ verificationCode?: string;
27
+ temporaryProof?: string;
28
+ phoneNumber?: string;
29
+ };
30
+
31
+ export class PhoneAuthCredential extends AuthCredential {
32
+ constructor(verificationId: string, verificationCode: string) {
33
+ super(providerId, providerId, verificationId, verificationCode);
34
+ }
35
+
36
+ toJSON(): object {
37
+ return {
38
+ verificationId: this.token,
39
+ verificationCode: this.secret,
40
+ providerId: this.providerId,
41
+ signInMethod: this.signInMethod,
42
+ };
43
+ }
44
+
45
+ static fromJSON(json: object | string): PhoneAuthCredential | null {
46
+ const parsed = parseCredentialJSON(json) as PhoneCredentialJSON | null;
47
+ if (!parsed) {
48
+ return null;
49
+ }
50
+
51
+ const verificationId = parsed.verificationId;
52
+ const verificationCode = parsed.verificationCode;
53
+ if (typeof verificationId !== 'string' || typeof verificationCode !== 'string') {
54
+ return null;
55
+ }
56
+
57
+ return new PhoneAuthCredential(verificationId, verificationCode);
58
+ }
59
+ }
60
+
61
+ export function createPhoneAuthCredential(
62
+ verificationId: string,
63
+ verificationCode: string,
64
+ ): PhoneAuthCredential {
65
+ return new PhoneAuthCredential(verificationId, verificationCode);
66
+ }
@@ -15,22 +15,7 @@
15
15
  *
16
16
  */
17
17
 
18
- const providerId = 'github.com';
19
-
20
- export default class GithubAuthProvider {
21
- constructor() {
22
- throw new Error('`new GithubAuthProvider()` is not supported on the native Firebase SDKs.');
23
- }
24
-
25
- static get PROVIDER_ID() {
26
- return providerId;
27
- }
28
-
29
- static credential(token) {
30
- return {
31
- token,
32
- secret: '',
33
- providerId,
34
- };
35
- }
36
- }
18
+ export { AuthCredential, parseCredentialJSON } from './AuthCredential';
19
+ export { EmailAuthCredential, createEmailAuthCredential } from './EmailAuthCredential';
20
+ export { OAuthCredential } from './OAuthCredential';
21
+ export { PhoneAuthCredential, createPhoneAuthCredential } from './PhoneAuthCredential';
@@ -0,0 +1,40 @@
1
+ import { isOther } from '@react-native-firebase/app/dist/module/common';
2
+ import MultiFactorResolver from './MultiFactorResolver';
3
+ import type { FirebaseAuthTypes } from './types/namespaced';
4
+ import type { AuthInternal } from './types/internal';
5
+
6
+ type ErrorWithResolver = FirebaseAuthTypes.MultiFactorError & {
7
+ userInfo?: {
8
+ resolver?: {
9
+ hints: FirebaseAuthTypes.MultiFactorResolver['hints'];
10
+ session: FirebaseAuthTypes.MultiFactorResolver['session'];
11
+ };
12
+ };
13
+ };
14
+
15
+ /**
16
+ * Create a new resolver based on an auth instance and error
17
+ * object.
18
+ *
19
+ * Returns null if no resolver object can be found on the error.
20
+ */
21
+ export function getMultiFactorResolver(
22
+ auth: AuthInternal,
23
+ error: ErrorWithResolver,
24
+ ): FirebaseAuthTypes.MultiFactorResolver | null {
25
+ if (isOther) {
26
+ return auth.native.getMultiFactorResolver(error) as FirebaseAuthTypes.MultiFactorResolver | null;
27
+ }
28
+ if (
29
+ error.hasOwnProperty('userInfo') &&
30
+ error.userInfo?.hasOwnProperty('resolver') &&
31
+ error.userInfo.resolver
32
+ ) {
33
+ return new MultiFactorResolver(
34
+ auth,
35
+ error.userInfo.resolver,
36
+ ) as unknown as FirebaseAuthTypes.MultiFactorResolver;
37
+ }
38
+
39
+ return null;
40
+ }
@@ -14,23 +14,18 @@
14
14
  * limitations under the License.
15
15
  *
16
16
  */
17
+ // modular API
18
+ export type * from './types/auth';
19
+ export { ActionCodeURL } from './ActionCodeURL';
20
+ export {
21
+ AuthCredential,
22
+ EmailAuthCredential,
23
+ OAuthCredential,
24
+ PhoneAuthCredential,
25
+ } from './credentials';
26
+ export * from './modular';
17
27
 
18
- const providerId = 'twitter.com';
19
-
20
- export default class TwitterAuthProvider {
21
- constructor() {
22
- throw new Error('`new TwitterAuthProvider()` is not supported on the native Firebase SDKs.');
23
- }
24
-
25
- static get PROVIDER_ID() {
26
- return providerId;
27
- }
28
-
29
- static credential(token, secret) {
30
- return {
31
- token,
32
- secret,
33
- providerId,
34
- };
35
- }
36
- }
28
+ // namespaced API
29
+ export * from './types/namespaced';
30
+ export * from './namespaced';
31
+ export { default } from './namespaced';