@react-native-firebase/auth 18.2.0 → 18.3.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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
+ ## [18.3.1](https://github.com/invertase/react-native-firebase/compare/v18.3.0...v18.3.1) (2023-08-23)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **auth, android:** avoid crash on react-native < 0.63 ([3fee0d6](https://github.com/invertase/react-native-firebase/commit/3fee0d6da587f56911669307e35558f55107c88e))
11
+
12
+ ## [18.3.0](https://github.com/invertase/react-native-firebase/compare/v18.2.0...v18.3.0) (2023-07-19)
13
+
14
+ ### Features
15
+
16
+ - **auth, revokeToken:** sign in with apple revokeToken API ([#7239](https://github.com/invertase/react-native-firebase/issues/7239)) ([2b9dc73](https://github.com/invertase/react-native-firebase/commit/2b9dc738259b200d47c79cc028becf691cb528d3))
17
+
6
18
  ## [18.2.0](https://github.com/invertase/react-native-firebase/compare/v18.1.0...v18.2.0) (2023-07-13)
7
19
 
8
20
  **Note:** Version bump only for package @react-native-firebase/auth
@@ -450,6 +450,21 @@ class ReactNativeFirebaseAuthModule extends ReactNativeFirebaseModule {
450
450
  });
451
451
  }
452
452
 
453
+ /**
454
+ * revokeToken
455
+ *
456
+ * @param authorizationCode
457
+ * @param promise
458
+ */
459
+ @ReactMethod
460
+ public void revokeToken(String appName, final String authorizationCode, final Promise promise) {
461
+ Log.d(TAG, "revokeToken");
462
+
463
+ // Revocation is not implemented on Android
464
+ Log.e(TAG, "revokeToken:failure:noCurrentUser");
465
+ promiseNoUser(promise, false);
466
+ }
467
+
453
468
  /**
454
469
  * sendPasswordResetEmail
455
470
  *
@@ -1929,7 +1944,10 @@ class ReactNativeFirebaseAuthModule extends ReactNativeFirebaseModule {
1929
1944
  */
1930
1945
  private void promiseRejectAuthException(Promise promise, Exception exception) {
1931
1946
  WritableMap error = getJSError(exception);
1932
- final String sessionId = error.getString("sessionId");
1947
+ String sessionId = null;
1948
+ if (error.hasKey("sessionId")) {
1949
+ sessionId = error.getString("sessionId");
1950
+ }
1933
1951
  final MultiFactorResolver multiFactorResolver = mCachedResolvers.get(sessionId);
1934
1952
  WritableMap resolverAsMap = Arguments.createMap();
1935
1953
  if (multiFactorResolver != null) {
@@ -663,6 +663,22 @@ RCT_EXPORT_METHOD(checkActionCode
663
663
  }];
664
664
  }
665
665
 
666
+ RCT_EXPORT_METHOD(revokeToken
667
+ : (FIRApp *)firebaseApp
668
+ : (NSString *)authorizationCode
669
+ : (RCTPromiseResolveBlock)resolve
670
+ : (RCTPromiseRejectBlock)reject) {
671
+ [[FIRAuth authWithApp:firebaseApp]
672
+ revokeTokenWithAuthorizationCode:authorizationCode
673
+ completion:^(NSError *_Nullable error) {
674
+ if (error) {
675
+ [self promiseRejectAuthException:reject error:error];
676
+ } else {
677
+ [self promiseNoUser:resolve rejecter:reject isError:NO];
678
+ }
679
+ }];
680
+ }
681
+
666
682
  RCT_EXPORT_METHOD(sendPasswordResetEmail
667
683
  : (FIRApp *)firebaseApp
668
684
  : (NSString *)email
package/lib/index.d.ts CHANGED
@@ -1722,6 +1722,22 @@ export namespace FirebaseAuthTypes {
1722
1722
  */
1723
1723
  signInWithCredential(credential: AuthCredential): Promise<UserCredential>;
1724
1724
 
1725
+ /**
1726
+ * Revokes a user's Sign in with Apple token.
1727
+ *
1728
+ * #### Example
1729
+ *
1730
+ * ```js
1731
+ * // Generate an Apple ID authorizationCode for the currently logged in user (ie, with @invertase/react-native-apple-authentication)
1732
+ * const { authorizationCode } = await appleAuth.performRequest({ requestedOperation: appleAuth.Operation.REFRESH });
1733
+ * // Revoke the token
1734
+ * await firebase.auth().revokeToken(authorizationCode);
1735
+ * ```
1736
+ *
1737
+ * @param authorizationCode A generated authorization code from Sign in with Apple.
1738
+ */
1739
+ revokeToken(authorizationCode: string): Promise<void>;
1740
+
1725
1741
  /**
1726
1742
  * Sends a password reset email to the given email address.
1727
1743
  * Unlike the web SDK, the email will contain a password reset link rather than a code.
package/lib/index.js CHANGED
@@ -299,6 +299,10 @@ class FirebaseAuthModule extends FirebaseModule {
299
299
  .then(userCredential => this._setUserCredential(userCredential));
300
300
  }
301
301
 
302
+ revokeToken(authorizationCode) {
303
+ return this.native.revokeToken(authorizationCode);
304
+ }
305
+
302
306
  sendPasswordResetEmail(email, actionCodeSettings = null) {
303
307
  return this.native.sendPasswordResetEmail(email, actionCodeSettings);
304
308
  }
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '18.2.0';
2
+ module.exports = '18.3.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/auth",
3
- "version": "18.2.0",
3
+ "version": "18.3.1",
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.0.5"
28
28
  },
29
29
  "peerDependencies": {
30
- "@react-native-firebase/app": "18.2.0",
30
+ "@react-native-firebase/app": "18.3.1",
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": "4c666df92028ddc3c0010a7ac102f54b600e6644"
45
+ "gitHead": "878f4199ca99963dec7822d1c9e14e9c91325b4f"
46
46
  }