nhost-dart icon indicating copy to clipboard operation
nhost-dart copied to clipboard

persistent Auth Example broken

Open chief-nerd opened this issue 2 years ago • 1 comments

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??

chief-nerd avatar Feb 17 '23 16:02 chief-nerd

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.

mhadaily avatar Feb 27 '23 09:02 mhadaily