logIn method

Future<void> logIn({
  1. String? email,
})

Log in and set the resulting user as the current user.

Implementation

Future<void> logIn({String? email}) async {
  if (_logOutFuture != null) await _logOutFuture;
  if (_tokenFuture != null) await _tokenFuture;

  _logInFuture ??= _runOrHandleTokenError(
    () => client.logIn(email: email).then(persistence.setCurrentUser),
  ).whenComplete(() => _logInFuture = null);

  return _logInFuture!;
}