auth static method

Future<LoggedInUserOrError> auth(
  1. String userName,
  2. String password
)

Authenticates the user, registering or logging them in with userName and password.

Implementation

static Future<LoggedInUserOrError> auth(
    String userName, String password) async {
  LoggedInUserOrError loggedInUserOrError =
      await LocalityAuth.register(userName, password);
  if (loggedInUserOrError.isError()) {
    loggedInUserOrError = await LocalityAuth.login(userName, password);
  }
  return loggedInUserOrError;
}