mraible/mobile-jhipster

React Native can't login on Android and doesn't render images

mraible opened this issue · 7 comments

  • login doesn’t work in React Native web or Android
  • photos don’t render in React Native iOS

What I see when I try to login via web to React Native app.

login-404-rn

Missing images:

Screen Shot 2021-11-06 at 11 21 46 PM

@ruddell I created my React Native app using these steps. If you have any ideas, please let me know!

Will check this week

Web login fails currently, started after Expo major version upgrade. Related open issue jhipster/generator-jhipster-react-native#395

Android/Web clients can now log in with OAuth2, added a route that redirects to the authUrl instead of NotFound.

The missing image styling was also added back (lost in a refactor at some point), so they should be visible now.

Both released as part of v4.2.1. Thanks for the report 👍

Hey Jon,

I'm still unable to log in with Android. It works fine with web and iOS, so I suspect my Keycloak settings are fine. I can also see the request being made to the JHipster backend to get the auth info. I've run the following command too:

adb reverse tcp:8080 tcp:8080 && adb reverse tcp:9080 tcp:9080

It just says login failed. I'm not sure why. I'm using Pixel_5_API_30 for my AVD.

image

I couldn't reproduce the login issue on Android with the latest release or the one out at the time of this issue. I updated the error messaging to reflect the reason for the failure which should help debugging.

I was able to reproduce this again today. Here's the error in my console:

Account - FAIL

No matching activity!
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in promiseMethodWrapper
at node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.native.js:15:23 in moduleName.methodInfo.name
at node_modules/expo-web-browser/build/WebBrowser.js:72:23 in openBrowserAsync
at node_modules/core-js/modules/es.promise.js:245:8 in Promise
at node_modules/expo-web-browser/build/WebBrowser.js:57:7 in openBrowserAsync
at node_modules/expo-web-browser/build/WebBrowser.js:164:43 in _openBrowserAndWaitAndroidAsync
at node_modules/core-js/modules/es.promise.js:245:8 in Promise
at node_modules/expo-web-browser/build/WebBrowser.js:158:0 in _openBrowserAndWaitAndroidAsync
at node_modules/expo-web-browser/build/WebBrowser.js:183:47 in _openAuthSessionPolyfillAsync
at node_modules/core-js/modules/es.promise.js:245:8 in Promise
at node_modules/expo-web-browser/build/WebBrowser.js:173:0 in _openAuthSessionPolyfillAsync
at node_modules/expo-web-browser/build/WebBrowser.js:97:44 in openAuthSessionAsync
at node_modules/core-js/modules/es.promise.js:245:8 in Promise
at node_modules/expo-web-browser/build/WebBrowser.js:86:7 in openAuthSessionAsync
at node_modules/expo-auth-session/build/AuthSession.js:153:25 in _openWebBrowserAsync
at node_modules/core-js/modules/es.promise.js:245:8 in Promise
at node_modules/expo-auth-session/build/AuthSession.js:151:0 in _openWebBrowserAsync
at node_modules/expo-auth-session/build/AuthSession.js:33:43 in startAsync
at node_modules/core-js/modules/es.promise.js:245:8 in Promise
at node_modules/expo-auth-session/build/AuthSession.js:12:7 in startAsync
at app/modules/login/login.utils.ts:77:27 in doOauthPkceFlow
at node_modules/core-js/modules/es.promise.js:115:20 in callReaction
at node_modules/core-js/modules/es.promise.js:140:11 in microtask$argument_0
at node_modules/core-js/internals/microtask.js:28:10 in flush

I followed these instructions.