auth0-angular: Android isAuthenticated$ does not fire
Describe the problem
isAuthenticated$ does not fired for exactly 60 seconds consistently after the app is allowed to sit for several minutes while logged in. I know this sounds ridiculous but it is what I am experiencing and desperately need help resolving it.
I’m using the Ionic Angular sample app located at https://github.com/auth0-samples/auth0-ionic-samples.
NOTE that if I install the app, launch it, login, close, and restart I do not see this behavior. It is only after letting the app sit in a logged in state for a period of time that this issue shows up.
I just tested the React sample on the same Android device and it exhibits the same issue with an added twist. The ‘Auth0 React Sample’ title does not even appear until 60 seconds after startup when the Login button shows.
I tested the React sample on an Android Emulator Pixel 3 API 29 and it exhibits the same issue as a device.
I have tested both the Angular and React sample app on the iOS platform with perfect functionality 😃.
I have tested in browsers with success also.
What was the expected behavior?
When app initially runs isAuthenticated$ should fire immediately with auth status.
Reproduction
- uninstall auth0-ionic-samples from android test device
- clone this repo https://github.com/auth0-samples/auth0-ionic-samples
- cd auth0-ionic-samples/angular
- npm i
- follow sample instructions and update auth.config.ts with domain and client id
- ionic cap run android
- app is running on android test device
- Login
- Leave app in the foreground for 5 minutes
- Close app without Logout
- run app
Login button will not be displayed as isAuthenticated$ does not fire 60 seconds later isAuthenticated$ fires and the Login button displays
Once this unusual behavior starts, it can not be stopped w/o an app uninstall
I am also not receiving my Auth0 profile pic properly as I do when running the sample app on iOS or web.
Logcat
2022-12-23 23:42:42.150 7279-7350/com.auth0.samples W/chromium: [WARNING:display_webview.cc(31)] WebView overlays are enabled! 2022-12-23 23:42:43.748 7279-7279/com.auth0.samples I/Capacitor/Console: File: http://localhost/main.js - Line 207 - Msg: ios: false android: true 2022-12-23 23:42:43.749 7279-7279/com.auth0.samples I/Capacitor/Console: File: http://localhost/main.js - Line 209 - Msg: com.auth0.samples://meetingmaker.us.auth0.com/capacitor/com.auth0.samples/callback 2022-12-23 23:42:44.127 7279-7279/com.auth0.samples I/Capacitor/Console: File: http://localhost/vendor.js - Line 80521 - Msg: Angular is running in development mode. Call enableProdMode() to enable production mode. 2022-12-23 23:42:44.149 7279-7344/com.auth0.samples D/Capacitor: Handling local request: http://localhost/common.js 2022-12-23 23:42:44.149 7279-7336/com.auth0.samples D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-app_8_entry_js.js 2022-12-23 23:42:44.156 7279-7279/com.auth0.samples V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 129665211, pluginId: App, methodName: addListener 2022-12-23 23:42:44.157 7279-7279/com.auth0.samples V/Capacitor: callback: 129665211, pluginId: App, methodName: addListener, methodData: {“eventName”:“appUrlOpen”} 2022-12-23 23:42:44.169 7279-7344/com.auth0.samples D/Capacitor: Handling local request: http://localhost/src_app_home_home_module_ts.js 2022-12-23 23:42:44.492 7279-7336/com.auth0.samples D/Capacitor: Handling local request: http://localhost/assets/icon/favicon.png 2022-12-23 23:42:44.604 7279-7279/com.auth0.samples V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 129665212, pluginId: App, methodName: addListener 2022-12-23 23:42:44.605 7279-7279/com.auth0.samples V/Capacitor: callback: 129665212, pluginId: App, methodName: addListener, methodData: {“eventName”:“backButton”} 2022-12-23 23:42:44.605 7279-7336/com.auth0.samples D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_index-0bc00b33_js.js 2022-12-23 23:42:44.605 7279-7344/com.auth0.samples D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_status-tap-20472ffa_js.js <app is loaded, home screen is blank> <note here is the 60s delay> 2022-12-23 23:43:44.803 7279-7331/com.auth0.samples D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-button_2_entry_js.js 2022-12-23 23:43:44.806 7279-7344/com.auth0.samples D/Capacitor: Handling local request: http://localhost/assets/icon/favicon.png 2022-12-23 23:43:44.886 7279-7344/com.auth0.samples D/Capacitor: Handling local request: http://localhost/node_modules_ionic_core_dist_esm_ion-ripple-effect_entry_js.js
Screenshots
Environment
-
Version of
auth0-angular
used: “@auth0/auth0-angular”: "^1.11.1” -
Which browsers have you tested in? None, I’m testing on an Android physical device moto g pure XT2163DL Android Version 12
-
Which version of Angular have you tested with? “@angular/core”: "^15.0.3”,
-
Other modules/plugins/libraries that might be involved: “rxjs”: "^7.8.0”, “typescript”: “^4.8.2”
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (7 by maintainers)
Ok, yes I may have something incorrectly configured and I am seeing now some errors in the tenant logs. I apologize the confusion. It’s 2:40am here and I’ve been working all day. I need to eat and sleep and address this tomorrow.
Thanks for your help.
@frederikprijck I have implemented your suggestions and I now have an acceptable level of functionality. Thank you for addressing this issue so quickly and providing a solution. I greatly appreciate the work the Auth0 team has put into providing us these drop in solutions that work effectively. As much time as I spent identifying this bug, I would have spent a whole lot more time implementing my own (buggy) auth client lib. Many thanks!