A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mongodb.com/docs/atlas/device-sdks/sdk/flutter/users/multiple-users/ below:

Work with Multiple Users - Flutter SDK - Atlas Device SDKs

The Realm SDK allows multiple users to be logged in to an app simultaneously on a given device. Atlas App Services client applications run in the context of a single active user even if multiple users are logged in simultaneously. You can quickly switch between authenticated users without requiring them to log in again.

Important

Any logged in user may become the active user without re-authenticating. Depending on your app, this may be a security vulnerability. For example, a user on a shared device may switch to a coworker's logged in account without providing their credentials or requiring their explicit permission. If your application requires stricter authentication, avoid switching between users and prefer to explicitly log the active user out before authenticating another user.

When a user first logs in through a Realm SDK on a given device or browser, the SDK saves the user's information and keeps track of the user's state on the device. The user's data remains on the device, even if they log out, unless you actively remove the user.

The following states describe an on-device user at any given time:

The following diagram shows how users within an App Services client app transition between states when certain events occur:

The Realm SDK automatically adds users to a device when they log in for the first time on that device. When a user logs in, they immediately become the application's active user.

final emailPwCredentials =    Credentials.emailPassword("lisa@example.com", "myStr0ngPassw0rd");await app.logIn(emailPwCredentials);

For more information on logging users in for the first time, refer to Register a New User Account.

You can access an Iterable of all user accounts that are stored on the device by reading your app's App.users property. This Iterable includes all users that have logged in to the client app on a given device regardless of whether they are currently authenticated.

You can remove all information about a user from the device and automatically log the user out by passing the User object to app.removeUser():

await app.removeUser(user!);

You can switch an app's active user to another logged in user by calling app.switchUser() on the User object you are switching to:

app.switchUser(otherUser);

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4