getCredentials static method

Credentials? getCredentials(
  1. UserId userId
)

Returns the stored in browser's storage Credentials identified by the provided UserId, if any.

Implementation

static Credentials? getCredentials(UserId userId) {
  if (web.window.localStorage['credentials_$userId'] == null) {
    return null;
  } else {
    return Credentials.fromJson(
      json.decode(web.window.localStorage['credentials_$userId']!),
    );
  }
}