@react-native-firebase/auth 21.12.0 → 21.12.2

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
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
+ ## [21.12.2](https://github.com/invertase/react-native-firebase/compare/v21.12.1...v21.12.2) (2025-03-23)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **auth:** Fix auth type definitions and add more ([#8323](https://github.com/invertase/react-native-firebase/issues/8323)) ([3dc8119](https://github.com/invertase/react-native-firebase/commit/3dc81195219a38b22294bec4490d4192c9d94fce))
11
+
12
+ ## [21.12.1](https://github.com/invertase/react-native-firebase/compare/v21.12.0...v21.12.1) (2025-03-22)
13
+
14
+ **Note:** Version bump only for package @react-native-firebase/auth
15
+
6
16
  ## [21.12.0](https://github.com/invertase/react-native-firebase/compare/v21.11.0...v21.12.0) (2025-03-03)
7
17
 
8
18
  **Note:** Version bump only for package @react-native-firebase/auth
@@ -58,6 +58,7 @@ export function applyActionCode(auth: Auth, oobCode: string): Promise<void>;
58
58
  * @param auth - The Auth instance.
59
59
  * @param callback - A callback function to run before the auth state changes.
60
60
  * @param onAbort - Optional. A callback function to run if the operation is aborted.
61
+ *
61
62
  */
62
63
  export function beforeAuthStateChanged(
63
64
  auth: Auth,
@@ -148,14 +149,21 @@ export function getMultiFactorResolver(
148
149
  * @param resolver - Optional. The popup redirect resolver.
149
150
  * @returns A promise that resolves with the user credentials or null.
150
151
  */
151
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
152
- export interface PopupRedirectResolver {}
153
-
154
152
  export function getRedirectResult(
155
153
  auth: Auth,
156
154
  resolver?: PopupRedirectResolver,
157
155
  ): Promise<FirebaseAuthTypes.UserCredential | null>;
158
156
 
157
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
158
+ export interface PopupRedirectResolver {}
159
+
160
+ /**
161
+ * Loads the reCAPTCHA configuration into the Auth instance.
162
+ * Does not work in a Node.js environment
163
+ * @param auth - The Auth instance.
164
+ */
165
+ export function initializeRecaptchaConfig(auth: Auth): Promise<void>;
166
+
159
167
  /**
160
168
  * Checks if an incoming link is a sign-in with email link suitable for signInWithEmailLink().
161
169
  *
@@ -189,6 +197,13 @@ export function onIdTokenChanged(
189
197
  nextOrObserver: CallbackOrObserver<AuthListenerCallback>,
190
198
  ): () => void;
191
199
 
200
+ /**
201
+ * Revoke the given access token, Currently only supports Apple OAuth access tokens.
202
+ * @param auth
203
+ * @param token
204
+ */
205
+ export declare function revokeAccessToken(auth: Auth, token: string): Promise<void>;
206
+
192
207
  /**
193
208
  * Sends a password reset email to the given email address.
194
209
  *
@@ -208,7 +223,7 @@ export function sendPasswordResetEmail(
208
223
  *
209
224
  * @param auth - The Auth instance.
210
225
  * @param email - The user's email address.
211
- * @param actionCodeSettings - Optional. Action code settings.
226
+ * @param actionCodeSettings - Optional, Action code settings.
212
227
  * @returns A promise that resolves when the email is sent.
213
228
  */
214
229
  export function sendSignInLinkToEmail(
@@ -300,7 +315,7 @@ export function signInWithEmailLink(
300
315
  * Interface representing an application verifier.
301
316
  */
302
317
  export interface ApplicationVerifier {
303
- type: string;
318
+ readonly type: string;
304
319
  verify(): Promise<string>;
305
320
  }
306
321
 
@@ -309,13 +324,15 @@ export interface ApplicationVerifier {
309
324
  *
310
325
  * @param auth - The Auth instance.
311
326
  * @param phoneNumber - The user's phone number.
312
- * @param appVerifier - The application verifier.
327
+ * @param appVerifier - Optional. The application verifier.
328
+ * @param forceResend - Optional. (Native only) Forces a new message to be sent if it was already recently sent.
313
329
  * @returns A promise that resolves with the confirmation result.
314
330
  */
315
331
  export function signInWithPhoneNumber(
316
332
  auth: Auth,
317
333
  phoneNumber: string,
318
- appVerifier: ApplicationVerifier,
334
+ appVerifier?: ApplicationVerifier,
335
+ forceResend?: boolean,
319
336
  ): Promise<FirebaseAuthTypes.ConfirmationResult>;
320
337
 
321
338
  /**
@@ -360,7 +377,7 @@ export function signInWithRedirect(
360
377
  auth: Auth,
361
378
  provider: FirebaseAuthTypes.AuthProvider,
362
379
  resolver?: PopupRedirectResolver,
363
- ): Promise<void>;
380
+ ): Promise<never>;
364
381
 
365
382
  /**
366
383
  * Signs out the current user.
@@ -377,7 +394,7 @@ export function signOut(auth: Auth): Promise<void>;
377
394
  * @param user - The user to set as the current user.
378
395
  * @returns A promise that resolves when the user is set.
379
396
  */
380
- export function updateCurrentUser(auth: Auth, user: FirebaseAuthTypes.User): Promise<void>;
397
+ export function updateCurrentUser(auth: Auth, user: FirebaseAuthTypes.User | null): Promise<void>;
381
398
 
382
399
  /**
383
400
  * Sets the current language to the default device/browser preference.
@@ -386,6 +403,15 @@ export function updateCurrentUser(auth: Auth, user: FirebaseAuthTypes.User): Pro
386
403
  */
387
404
  export function useDeviceLanguage(auth: Auth): void;
388
405
 
406
+ /**
407
+ * Validates the password against the password policy configured for the project or tenant.
408
+ *
409
+ * @param auth - The Auth instance.
410
+ * @param password - The password to validate.
411
+ *
412
+ */
413
+ export function validatePassword(auth: Auth, password: string): Promise<PasswordValidationStatus>;
414
+
389
415
  /**
390
416
  * Sets the current language to the default device/browser preference.
391
417
  *
@@ -464,7 +490,7 @@ export function linkWithCredential(
464
490
  export function linkWithPhoneNumber(
465
491
  user: FirebaseAuthTypes.User,
466
492
  phoneNumber: string,
467
- appVerifier: ApplicationVerifier,
493
+ appVerifier?: ApplicationVerifier,
468
494
  ): Promise<FirebaseAuthTypes.ConfirmationResult>;
469
495
 
470
496
  /**
@@ -526,7 +552,7 @@ export function reauthenticateWithCredential(
526
552
  export function reauthenticateWithPhoneNumber(
527
553
  user: FirebaseAuthTypes.User,
528
554
  phoneNumber: string,
529
- appVerifier: ApplicationVerifier,
555
+ appVerifier?: ApplicationVerifier,
530
556
  ): Promise<FirebaseAuthTypes.ConfirmationResult>;
531
557
 
532
558
  /**
@@ -642,7 +668,7 @@ export function updateProfile(
642
668
  export function verifyBeforeUpdateEmail(
643
669
  user: FirebaseAuthTypes.User,
644
670
  newEmail: string,
645
- actionCodeSettings?: FirebaseAuthTypes.ActionCodeSettings,
671
+ actionCodeSettings?: FirebaseAuthTypes.ActionCodeSettings | null,
646
672
  ): Promise<void>;
647
673
 
648
674
  /**
@@ -659,6 +685,23 @@ export function getAdditionalUserInfo(
659
685
  * Returns the custom auth domain for the auth instance.
660
686
  *
661
687
  * @param auth - The Auth instance.
662
- * @returns A promise that resolves with the custom auth domain.
688
+ * @returns {Promise<string>} A promise that resolves with the custom auth domain.
663
689
  */
664
690
  export function getCustomAuthDomain(auth: Auth): Promise<string>;
691
+
692
+ /**
693
+ * Various Providers.
694
+ *
695
+ *
696
+ */
697
+ export {
698
+ AppleAuthProvider,
699
+ EmailAuthProvider,
700
+ FacebookAuthProvider,
701
+ GithubAuthProvider,
702
+ GoogleAuthProvider,
703
+ OAuthProvider,
704
+ OIDCAuthProvider,
705
+ PhoneAuthProvider,
706
+ TwitterAuthProvider,
707
+ } from '../index';
@@ -16,6 +16,8 @@
16
16
  */
17
17
 
18
18
  import { getApp } from '@react-native-firebase/app';
19
+ import FacebookAuthProvider from '../providers/FacebookAuthProvider';
20
+ export { FacebookAuthProvider };
19
21
 
20
22
  /**
21
23
  * @typedef {import('@firebase/app-types').FirebaseApp} FirebaseApp
@@ -187,6 +189,15 @@ export function onIdTokenChanged(auth, nextOrObserver) {
187
189
  return auth.onIdTokenChanged(nextOrObserver);
188
190
  }
189
191
 
192
+ /**
193
+ * Revoke the given access token, Currently only supports Apple OAuth access tokens.
194
+ * @param auth - The Auth Instance.
195
+ * @param token - The Access Token
196
+ */
197
+ export async function revokeAccessToken(auth, token) {
198
+ throw new Error('revokeAccessToken() is only supported on Web');
199
+ } //TO DO: Add Support
200
+
190
201
  /**
191
202
  * Sends a password reset email to the given email address.
192
203
  * @param {Auth} auth - The Auth instance.
@@ -342,6 +353,17 @@ export function useDeviceLanguage(auth) {
342
353
  throw new Error('useDeviceLanguage is unsupported by the native Firebase SDKs');
343
354
  }
344
355
 
356
+ /**
357
+ * Validates the password against the password policy configured for the project or tenant.
358
+ *
359
+ * @param auth - The Auth instance.
360
+ * @param password - The password to validate.
361
+ *
362
+ */
363
+ export function validatePassword(auth, password) {
364
+ throw new Error('validatePassword is only supported on Web');
365
+ } //TO DO: ADD support.
366
+
345
367
  /**
346
368
  * Sets the current language to the default device/browser preference.
347
369
  * @param {Auth} auth - The Auth instance.
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '21.12.0';
2
+ module.exports = '21.12.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/auth",
3
- "version": "21.12.0",
3
+ "version": "21.12.2",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - The authentication module provides an easy-to-use API to integrate an authentication workflow into new and existing applications. React Native Firebase provides access to all Firebase authentication methods and identity providers.",
6
6
  "main": "lib/index.js",
@@ -27,7 +27,7 @@
27
27
  "plist": "^3.1.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@react-native-firebase/app": "21.12.0",
30
+ "@react-native-firebase/app": "21.12.2",
31
31
  "expo": ">=47.0.0"
32
32
  },
33
33
  "devDependencies": {
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "00a5540bc2d8007858dd01903d8f8c171587a766"
45
+ "gitHead": "31e92391eddbebe8e665b596838d329c70640550"
46
46
  }