@react-native-firebase/auth 21.10.1 → 21.12.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.
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.0](https://github.com/invertase/react-native-firebase/compare/v21.11.0...v21.12.0) (2025-03-03)
7
+
8
+ **Note:** Version bump only for package @react-native-firebase/auth
9
+
10
+ ## [21.11.0](https://github.com/invertase/react-native-firebase/compare/v21.10.1...v21.11.0) (2025-02-20)
11
+
12
+ ### Features
13
+
14
+ - **auth:** `linkDomain` support for `ActionCodeSettings` ([#8335](https://github.com/invertase/react-native-firebase/issues/8335)) ([77af6b2](https://github.com/invertase/react-native-firebase/commit/77af6b2c444084f232254db79a667930cb4fa770))
15
+
6
16
  ## [21.10.1](https://github.com/invertase/react-native-firebase/compare/v21.10.0...v21.10.1) (2025-02-18)
7
17
 
8
18
  **Note:** Version bump only for package @react-native-firebase/auth
@@ -2576,6 +2576,11 @@ class ReactNativeFirebaseAuthModule extends ReactNativeFirebaseModule {
2576
2576
  builder = builder.setDynamicLinkDomain(actionCodeSettings.getString("dynamicLinkDomain"));
2577
2577
  }
2578
2578
 
2579
+ if (actionCodeSettings.hasKey("linkDomain")) {
2580
+ builder =
2581
+ builder.setLinkDomain(Objects.requireNonNull(actionCodeSettings.getString("linkDomain")));
2582
+ }
2583
+
2579
2584
  if (actionCodeSettings.hasKey("android")) {
2580
2585
  ReadableMap android = actionCodeSettings.getMap("android");
2581
2586
  boolean installApp =
@@ -44,6 +44,7 @@ static NSString *const keyMinVersion = @"minimumVersion";
44
44
  static NSString *const constAppLanguage = @"APP_LANGUAGE";
45
45
  static NSString *const constAppUser = @"APP_USER";
46
46
  static NSString *const keyHandleCodeInApp = @"handleCodeInApp";
47
+ static NSString *const keyLinkDomain = @"linkDomain";
47
48
  static NSString *const keyDynamicLinkDomain = @"dynamicLinkDomain";
48
49
  static NSString *const keyAdditionalUserInfo = @"additionalUserInfo";
49
50
  static NSString *const AUTH_STATE_CHANGED_EVENT = @"auth_state_changed";
@@ -1765,6 +1766,11 @@ RCT_EXPORT_METHOD(useEmulator
1765
1766
  NSString *url = actionCodeSettings[keyUrl];
1766
1767
  [settings setURL:[NSURL URLWithString:url]];
1767
1768
 
1769
+ if (actionCodeSettings[keyLinkDomain]) {
1770
+ NSString *linkDomain = actionCodeSettings[keyLinkDomain];
1771
+ [settings setLinkDomain:linkDomain];
1772
+ }
1773
+
1768
1774
  if (actionCodeSettings[keyHandleCodeInApp]) {
1769
1775
  BOOL handleCodeInApp = [actionCodeSettings[keyHandleCodeInApp] boolValue];
1770
1776
  [settings setHandleCodeInApp:handleCodeInApp];
package/lib/User.js CHANGED
@@ -16,6 +16,7 @@
16
16
  */
17
17
 
18
18
  import { isObject, isString, isUndefined, isBoolean } from '@react-native-firebase/app/lib/common';
19
+ import { warnDynamicLink } from './utils';
19
20
 
20
21
  export default class User {
21
22
  constructor(auth, user) {
@@ -131,6 +132,7 @@ export default class User {
131
132
  }
132
133
 
133
134
  sendEmailVerification(actionCodeSettings) {
135
+ warnDynamicLink(actionCodeSettings);
134
136
  if (isObject(actionCodeSettings)) {
135
137
  if (!isString(actionCodeSettings.url)) {
136
138
  throw new Error(
@@ -147,6 +149,12 @@ export default class User {
147
149
  );
148
150
  }
149
151
 
152
+ if (!isUndefined(actionCodeSettings.linkDomain) && !isString(actionCodeSettings.linkDomain)) {
153
+ throw new Error(
154
+ "firebase.auth.User.sendEmailVerification(*) 'actionCodeSettings.linkDomain' expected a string value.",
155
+ );
156
+ }
157
+
150
158
  if (
151
159
  !isUndefined(actionCodeSettings.handleCodeInApp) &&
152
160
  !isBoolean(actionCodeSettings.handleCodeInApp)
@@ -241,6 +249,7 @@ export default class User {
241
249
  }
242
250
 
243
251
  verifyBeforeUpdateEmail(newEmail, actionCodeSettings) {
252
+ warnDynamicLink(actionCodeSettings);
244
253
  if (!isString(newEmail)) {
245
254
  throw new Error(
246
255
  "firebase.auth.User.verifyBeforeUpdateEmail(*) 'newEmail' expected a string value.",
@@ -263,6 +272,12 @@ export default class User {
263
272
  );
264
273
  }
265
274
 
275
+ if (!isUndefined(actionCodeSettings.linkDomain) && !isString(actionCodeSettings.linkDomain)) {
276
+ throw new Error(
277
+ "firebase.auth.User.verifyBeforeUpdateEmail(_, *) 'actionCodeSettings.linkDomain' expected a string value.",
278
+ );
279
+ }
280
+
266
281
  if (
267
282
  !isUndefined(actionCodeSettings.handleCodeInApp) &&
268
283
  !isBoolean(actionCodeSettings.handleCodeInApp)
package/lib/index.d.ts CHANGED
@@ -881,6 +881,7 @@ export namespace FirebaseAuthTypes {
881
881
 
882
882
  /**
883
883
  * Sets the dynamic link domain (or subdomain) to use for the current link if it is to be opened using Firebase Dynamic Links. As multiple dynamic link domains can be configured per project, this field provides the ability to explicitly choose one. If none is provided, the first domain is used by default.
884
+ * Deprecated - use {@link ActionCodeSettings.linkDomain} instead.
884
885
  */
885
886
  dynamicLinkDomain?: string;
886
887
 
@@ -888,6 +889,11 @@ export namespace FirebaseAuthTypes {
888
889
  * This URL represents the state/Continue URL in the form of a universal link. This URL can should be constructed as a universal link that would either directly open the app where the action code would be handled or continue to the app after the action code is handled by Firebase.
889
890
  */
890
891
  url: string;
892
+ /**
893
+ * Firebase Dynamic Links is deprecated and will be shut down as early as August * 2025.
894
+ * Instead, use ActionCodeSettings.linkDomain to set a a custom domain. Learn more at: https://firebase.google.com/support/dynamic-links-faq
895
+ */
896
+ linkDomain?: string;
891
897
  }
892
898
 
893
899
  /**
@@ -1342,8 +1348,7 @@ export namespace FirebaseAuthTypes {
1342
1348
  reauthenticateWithCredential(credential: AuthCredential): Promise<UserCredential>;
1343
1349
 
1344
1350
  /**
1345
- * Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo)
1346
- *
1351
+ * Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
1347
1352
  * #### Example
1348
1353
  *
1349
1354
  * ```js
@@ -1359,9 +1364,17 @@ export namespace FirebaseAuthTypes {
1359
1364
  * @error auth/invalid-verification-code Thrown if the credential is a auth.PhoneAuthProvider.credential and the verification code of the credential is not valid.
1360
1365
  * @error auth/invalid-verification-id Thrown if the credential is a auth.PhoneAuthProvider.credential and the verification ID of the credential is not valid.
1361
1366
  * @param provider A created {@link auth.AuthProvider}.
1367
+ * @returns A promise that resolves with no value.
1362
1368
  */
1363
- reauthenticateWithProvider(provider: AuthProvider): Promise<UserCredential>;
1364
-
1369
+ reauthenticateWithRedirect(provider: AuthProvider): Promise<void>;
1370
+ /**
1371
+ * Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
1372
+ * pop-up equivalent on native platforms.
1373
+ *
1374
+ * @param provider - The auth provider.
1375
+ * @returns A promise that resolves with the user credentials.
1376
+ */
1377
+ reauthenticateWithPopup(provider: AuthProvider): Promise<UserCredential>;
1365
1378
  /**
1366
1379
  * Refreshes the current user.
1367
1380
  *
package/lib/index.js CHANGED
@@ -46,6 +46,7 @@ import PhoneAuthProvider from './providers/PhoneAuthProvider';
46
46
  import TwitterAuthProvider from './providers/TwitterAuthProvider';
47
47
  import version from './version';
48
48
  import fallBackModule from './web/RNFBAuthModule';
49
+ import { warnDynamicLink } from './utils';
49
50
 
50
51
  export {
51
52
  AppleAuthProvider,
@@ -350,10 +351,12 @@ class FirebaseAuthModule extends FirebaseModule {
350
351
  }
351
352
 
352
353
  sendPasswordResetEmail(email, actionCodeSettings = null) {
354
+ warnDynamicLink(actionCodeSettings);
353
355
  return this.native.sendPasswordResetEmail(email, actionCodeSettings);
354
356
  }
355
357
 
356
358
  sendSignInLinkToEmail(email, actionCodeSettings = {}) {
359
+ warnDynamicLink(actionCodeSettings);
357
360
  return this.native.sendSignInLinkToEmail(email, actionCodeSettings);
358
361
  }
359
362
 
@@ -530,11 +530,11 @@ export function reauthenticateWithPhoneNumber(
530
530
  ): Promise<FirebaseAuthTypes.ConfirmationResult>;
531
531
 
532
532
  /**
533
- * Reauthenticates the current user with the specified OAuthProvider using a pop-up based OAuth flow.
533
+ * Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
534
534
  *
535
535
  * @param user - The user to re-authenticate.
536
536
  * @param provider - The auth provider.
537
- * @param resolver - Optional. The popup redirect resolver.
537
+ * @param resolver - Optional. The popup redirect resolver. Web only.
538
538
  * @returns A promise that resolves with the user credentials.
539
539
  */
540
540
  export function reauthenticateWithPopup(
@@ -544,12 +544,12 @@ export function reauthenticateWithPopup(
544
544
  ): Promise<FirebaseAuthTypes.UserCredential>;
545
545
 
546
546
  /**
547
- * Reauthenticates the current user with the specified OAuthProvider using a full-page redirect flow.
547
+ * Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
548
548
  *
549
549
  * @param user - The user to re-authenticate.
550
550
  * @param provider - The auth provider.
551
- * @param resolver - Optional. The popup redirect resolver.
552
- * @returns A promise that resolves when the redirect is complete.
551
+ * @param resolver - Optional. The popup redirect resolver. Web only.
552
+ * @returns A promise that resolves with no value.
553
553
  */
554
554
  export function reauthenticateWithRedirect(
555
555
  user: FirebaseAuthTypes.User,
@@ -474,10 +474,10 @@ export async function reauthenticateWithPhoneNumber(user, phoneNumber, appVerifi
474
474
  }
475
475
 
476
476
  /**
477
- * Reauthenticates the current user with the specified OAuthProvider using a pop-up based OAuth flow.
477
+ * Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
478
478
  * @param {User} user - The user to re-authenticate.
479
479
  * @param {AuthProvider} provider - The auth provider.
480
- * @param {PopupRedirectResolver} [resolver] - Optional. The popup redirect resolver.
480
+ * @param {PopupRedirectResolver} [resolver] - Optional. The popup redirect resolver. Web only.
481
481
  * @returns {Promise<UserCredential>}
482
482
  */
483
483
  export async function reauthenticateWithPopup(user, provider, resolver) {
@@ -485,11 +485,11 @@ export async function reauthenticateWithPopup(user, provider, resolver) {
485
485
  }
486
486
 
487
487
  /**
488
- * Reauthenticates the current user with the specified OAuthProvider using a full-page redirect flow.
488
+ * Re-authenticate a user with a federated authentication provider (Microsoft, Yahoo). For native platforms, this will open a browser window.
489
489
  * @param {User} user - The user to re-authenticate.
490
490
  * @param {AuthProvider} provider - The auth provider.
491
- * @param {PopupRedirectResolver} [resolver] - Optional. The popup redirect resolver.
492
- * @returns {Promise<void>}
491
+ * @param {PopupRedirectResolver} [resolver] - Optional. The popup redirect resolver. Web only.
492
+ * @returns {Promise<UserCredential>}
493
493
  */
494
494
  export async function reauthenticateWithRedirect(user, provider, resolver) {
495
495
  return user.reauthenticateWithRedirect(provider, resolver);
package/lib/utils.js ADDED
@@ -0,0 +1,9 @@
1
+ export function warnDynamicLink(actionCodeSettings) {
2
+ if (actionCodeSettings && actionCodeSettings.dynamicLinkDomain) {
3
+ // eslint-disable-next-line no-console
4
+ console.warn(
5
+ 'Firebase Dynamic Links is deprecated and will be shut down as early as August * 2025. \
6
+ Instead, use ActionCodeSettings.linkDomain to set up a custom domain. Learn more at: https://firebase.google.com/support/dynamic-links-faq',
7
+ );
8
+ }
9
+ }
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '21.10.1';
2
+ module.exports = '21.12.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/auth",
3
- "version": "21.10.1",
3
+ "version": "21.12.0",
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.10.1",
30
+ "@react-native-firebase/app": "21.12.0",
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": "153637d27bb98b1f44a4b27fe1f8ec133bdbfb6d"
45
+ "gitHead": "00a5540bc2d8007858dd01903d8f8c171587a766"
46
46
  }