loginWithUserCredentials method

Future<Session> loginWithUserCredentials(
  1. String username,
  2. String password
)

Implementation

Future<Session> loginWithUserCredentials(String username, String password) async {
  var body = <String, String>{
    "grant_type": "password",
    "client_id": this.config.clientId,
    "username": username,
    "password": password,
  };
  return apiPost("/access/token", body)
      .then((res) => processAccessToken(res));
  // TODO UNCOMMENT when server side fixed.
  //.then((session) => apiMe().then((u) => session) )
  //.then((session) =>  createDevice().then((value) => session) );
}