Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not remain logged #68

Open
miguelangelflores1993 opened this issue Jun 8, 2023 · 1 comment
Open

does not remain logged #68

miguelangelflores1993 opened this issue Jun 8, 2023 · 1 comment

Comments

@miguelangelflores1993
Copy link

  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

@tanutapi
Copy link
Owner

tanutapi commented Jun 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants