-
Notifications
You must be signed in to change notification settings - Fork 462
Description
Issue
This is related to the fix here: #352 and the initial issue here: #130
When onActivityResult is called (e.g. when returning to app from another app) the intent can be null. This triggers the following flow:
react-native-app-auth/android/src/main/java/com/rnappauth/RNAppAuthModule.java
Lines 302 to 305 in cffea61
| if (data == null) { | |
| promise.reject("Failed to authenticate", "Data intent is null" ); | |
| return; | |
| } |
Which try's to do the following:
promise.reject("Failed to authenticate", "Data intent is null" );
However if none of the other exported functions in this module are called then the promise instance variable is null. Because the promise is only set when the other functions are called. e.g.
| this.promise = promise; |
I think we should check if the promise is set before calling it in the onActivityResult function?
I'm going to play around with a fix since this is effecting us in a production app at the moment!
Environment
- Your Identity Provider:
* - Platform that you're experiencing the issue on:
Android - Are you using Expo?:
no - Package version?:
5.0.0-rc3