nhost-dart
nhost-dart copied to clipboard
JWTExpired errors after leaving the app open for a short while
I'm seeing JWTExpired errors when leaving the app open for a bit, suggesting the token refresh is not working correctly. It's a dealbreaker right now in terms of being able to use nhost in production because after a fairly short amount of time the app breaks because all queries/mutations/subscriptions stop executing and you have to refresh the entire app.
Similar to #21 but the errors I'm seeing are for any type of operation, not just subscriptions, so I don't think it's purely a websocket problem. I also saw https://github.com/nhost/nhost/issues/405 and it seems that the JS library had a very similar issue, so it might be that the Dart/Flutter library needs to implement the same logic to make sure that the app does not allow the JWT to expire.
Did you try simple implementation of this without any extra code? i am leaving my app open when i.e. eating lunch and it never yelled at me, that the token expired. After like 2 months of using it, i didnt have this problem once.
Can you try latest BETA version https://pub.dev/packages/nhost_sdk/versions/4.0.0-dev.8
It reuiqres you to pass subdomain and region
It's still there in 4.0.0.dev.13
User gets logged out after some time, automatically. Using all dependencies with 3.x-dev.x versions. Any hints?
please use new package https://pub.dev/packages/nhost_dart I will depreciate the old package soon.
There is a maximum expiry date for the token however refresh token is issued, therefore, you can silently call the Refresh method to renew the token. This will avoid logout user
Please see this https://github.com/nhost/nhost-dart/issues/91#issuecomment-1378566909
Hi,
Thanks for the quick update. Will go through it and let you know how it goes!