Skip to content

Commit

Permalink
fix: reject promise after setting it
Browse files Browse the repository at this point in the history
  • Loading branch information
faizplus committed May 8, 2024
1 parent aa69d7b commit 694482b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion android/src/main/java/com/rnappauth/RNAppAuthModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,15 @@ public void logout(
dangerouslyAllowInsecureHttpRequests, androidAllowCustomBrowsers);
final HashMap<String, String> additionalParametersMap = MapUtil.readableMapToHashMap(additionalParameters);

this.promise = promise;

// Check if the device is connected to a network
if (!isNetworkConnected()) {
// If not connected, reject the promise with a network_error status and message
promise.reject("network_error", "No network connectivity");
return;
}

this.promise = promise;

if (serviceConfiguration != null || hasServiceConfiguration(issuer)) {
try {
Expand Down

0 comments on commit 694482b

Please sign in to comment.