login method
se loguea al host */
Implementation
Future login({
required String user,
required String pass,
String host = 'main',
required String app,
required String projectId,
}) async {
//
// consulta para loguearse
var r = await request('/sistema/login/access',
data: {
'user': user,
'pass': pass,
'app': name,
'projectId': projectIid
},
host: host);
// marcando el primero uso
if (firstTimeUse.isEmpty) {
var ahora = DateTime.now().toIso8601String();
await LocalStorage.setTo('firstTimeUse', ahora);
firstTimeUse = ahora;
}
await _onLogged();
return r;
}