nhost / nhost-dart

Nhost Dart & Flutter packages
https://nhost.io
MIT License
90 stars 32 forks source link

persistent Auth Example broken #101

Open chief-nerd opened 1 year ago

chief-nerd commented 1 year ago

Flutter auth SDK seems to be broken

My Code (with go_router) https://gist.github.com/chief-nerd/c5dc85a40c9f72040e7a4b6875189606 which is pretty much the code from https://github.com/nhost/nhost-dart/blob/main/packages/nhost_flutter_auth/example/lib/persistent_auth_example.dart

I see on Web in my Chrome Application that the token is being put into store. But when I do a reload of the application I am logged out again.

Do I need to call nhostClient.auth.signInWithStoredCredentials(); manually? Cause it's not called during init of the application??

mhadaily commented 1 year ago

Hi, Yes, There is an example here https://github.com/nhost/nhost-dart/issues/91

I am, at the moment, creating a better way to handle this out of the box in the library; it'll come out as soon as we have a stable release. More examples are also on the way.