oktadev / schematics

Schematics for adding Okta and Auth0 Auth to your projects
https://auth0.com/blog/quick-javascript-authentication/
Apache License 2.0
73 stars 29 forks source link

Ionic Capacitor Blank Screen On App Launch When Refresh Token Expired #446

Closed zlannin closed 3 years ago

zlannin commented 3 years ago

After a users refresh token has expired, users are stuck on a blank white screen after the splash screen.

"@oktadev/schematics": "^0.8.3" "ionic-appauth": "0.3.5",

⚡️  Loading app at capacitor://localhost...
⚡️  [log] - onscript loading complete
To Native Cordova ->  File requestAllPaths File866088915 ["options": []]
⚡️  WebView loaded
⚡️  [warn] - [DEPRECATION][Events]: The Events provider is deprecated and it will be removed in the next major release.
  - Use "Observables" for a similar pub/sub architecture: https://angular.io/guide/observables
  - Use "Redux" for advanced state management: https://ngrx.io
⚡️  To Native ->  PushNotifications addListener 52738932
⚡️  To Native ->  PushNotifications addListener 52738933
⚡️  To Native ->  PushNotifications addListener 52738934
⚡️  To Native ->  PushNotifications addListener 52738935
⚡️  To Native ->  LocalNotifications addListener 52738936
⚡️  [log] - Ionic Native: deviceready event fired after 250 ms
⚡️  To Native ->  App addListener 52738937
⚡️  To Native ->  Storage get 52738938
⚡️  TO JS {"value":"{\"access_token\":\"eyJraWQi...
⚡️  [warn] - Native: tried calling StatusBar.styleDefault, but the StatusBar plugin is not installed.
⚡️  [warn] - Install the StatusBar plugin: 'ionic cordova plugin add cordova-plugin-statusbar'
⚡️  To Native ->  SplashScreen hide 52738939
⚡️  TO JS {}
To Native Cordova ->  CordovaHttpPlugin get CordovaHttpPlugin866088916 ["options": [https://dev-XXXXXX.okta.com/oauth2/default/.well-known/openid-configuration, {
    Cookie = "JSESSIONID=8783F468F2B64247576ADA5C0B1B5F54";
}, 60, 1, text]]
⚡️  To Native ->  App addListener 52738940
To Native Cordova ->  CordovaHttpPlugin post CordovaHttpPlugin866088917 ["options": [https://login.example.com/oauth2/default/v1/token, {
    text = "grant_type=refresh_token&client_id=<client id>&redirect_uri=com.okta.dev-XXXXXX%3A%2Fcallback&refresh_token=NOzwzVmCK3Jq...";
}, utf8, {
    "Content-Type" = "application/x-www-form-urlencoded";
    Cookie = "JSESSIONID=63B7DB0D48B8044E44631B161501FF82";
}, 60, 1, text]]
2020-11-03 13:21:40.996503-0600 App[4297:153886] [tcp] tcp_output [C2.1:3] flags=[R.] seq=4215262083, ack=4173473411, win=8191 state=CLOSED rcv_nxt=4173473411, snd_una=4215262052
⚡️  [error] - ERROR Error: Uncaught (in promise): Object: {"status":400,"headers":{"content-type":"application/json;charset=UTF-8","x-rate-limit-limit":"2000","p3p":"CP=\"HONK\"","pragma":"no-cache","x-rate-limit-remaining":"1999","x-xss-protection":"0","server":"nginx","x-okta-request-id":"X6GtxPRTp39hUKnc@IH-WQAAAdY","expires":"0","set-cookie":"sid=\"\"; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=46722BF277E7D57C4DEEC94C53735901; Path=/; Secure; HttpOnly","transfer-encoding":"Identity","cache-control":"no-cache, no-store","date":"Tue, 03 Nov 2020 19:21:40 GMT","strict-transport-security":"max-age=315360000; includeSubDomains","connection":"close","x-content-type-options":"nosniff","x-rate-limit-reset":"1604431360"},"url":"https://login.example.com/oauth2/default/v1/token","error":"{\"error\":\"invalid_grant\",\"error_description\":\"The refresh token is invalid or expired.\"}"}
mraible commented 3 years ago

Can you try creating an app with the latest version 3.0.0 version and see if this still happens? Capacitor is now the default.

https://github.com/oktadeveloper/schematics#ionic

zlannin commented 3 years ago

The upgrade appears to have resolved the issue on my device.