dart_meteor icon indicating copy to clipboard operation
dart_meteor copied to clipboard

does not remain logged

Open miguelangelflores1993 opened this issue 2 years ago • 1 comments

  1. 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

miguelangelflores1993 avatar Jun 08 '23 19:06 miguelangelflores1993

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.

tanutapi avatar Jun 09 '23 02:06 tanutapi