does not remain logged
- When I login, everything works great, change the password
it starts to fail, when the user closes the application, the session is lost, and he cannot change his password I get this error
I/flutter(13021): isClientSafe: true
I/flutter (13021): errorType: Meteor.Error
I/flutter(13021): error: 401
I/flutter (13021): details: null
I/flutter (13021): message: Must be logged in [401]
I/flutter (13021): reason: Must be logged in
I/flutter(13021): stack: null
How can you keep the session? @tanutapi please urgent
The dart_meteor does not keep the login state across the app close and reopening. You must manage it yourself.
When you do a meteor.loginWithPassword, it will return a MeteorClientLoginResult object, which has a field named token in it. You must securely store that returned token in your app's secure storage. When you open your app again, you must check whether you have a token in your secure storage. If you have it, you can try meteor.loginWithToken to log the user in without any prompt for username/password.