auth0 / react-native-auth0

React Native toolkit for Auth0 API
https://auth0.com
MIT License
481 stars 206 forks source link

authorize module never resolves after successful login on Android #977

Open DigohD opened 6 days ago

DigohD commented 6 days ago

Checklist

Description

We've created a barebones React Native project, only implementing the instructions of the quickstart guide in the auth0 dashboard. The login browser module which opens with aurhorize() works as intended, except for when a correct login is entered.

In the Auth0 dashboard logs we can see that registration, email verification and login are successful. But the login module never resolves in the application, and nothing happens after a successful login.

Callback URL configured in the dashboard for the app is: com.authnullte.auth0://digohd.eu.auth0.com/android/com.authnullte/callback

This seems to be correct, since the module does not load at all if we change it.

Reproduction

  1. clone https://github.com/DigohD/auth0-react-native-minimal-repro
  2. install node modules (npm i)
  3. run app on Android device/emulator (npx react-native run-android)
  4. Within the started app, press "Log in"
  5. Register an account via auth0 module and try to log in
  6. if correct credentials are provided, the loading bar of the browser appears and the window is then stuck. Nothing more happens

This is reproducible for all 3 of our develpers who have tried to solve the issue.

Additional context

If we add:

<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
  android:host="digohd.eu.auth0.com"
  android:pathPrefix="/android/${applicationId}/callback"
  android:scheme="${applicationId}.auth0" />

To the AndroidManifest.xml the module resolves after login and we're returned to the application as expected. However, credentials are undefined, either when checking the promise handling argument authorize(...).then(...), or when using getCredentials() provided by useAuth0() hook. We tried both after awaiting authorization and not awaiting.

react-native-auth0 version

3.2.1 and 4.0.0-beta.0

React Native version

0.74.3 and 0.75.3

Expo version

none

Platform

Android

Platform version(s)

14