Is there a "remember me" in the login?

Hi. I’m refer and coding below document with using flutter sdk.

But I faced that a new login is required every time the app is launched.

This is very inconvenient. Is there any kind of automatically login like a “remember me”?

Hey, this doesn’t seem to be well covered in the docs, but the default behavior for the SDK is to remember logged-in users. You can access the current user by calling app.currentUser. So your app could work something like this:

var user = app.currentUser;
if (user == null) {
  // when the login call is successful, app.currentUser will become user
  user = await app.logIn(Credentials.anonymous());
}

return user;

If you want to support multiple users in your app (similar to Netflix/Youtube), you can refer to this page in the docs for help.

2 Likes