auth static method
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;
}