This commit is contained in:
@@ -29,6 +29,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
JWT = string.Empty;
|
JWT = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region INIT / AUTH
|
||||||
private static void InitClient()
|
private static void InitClient()
|
||||||
{
|
{
|
||||||
if (Initialized) return;
|
if (Initialized) return;
|
||||||
@@ -98,20 +100,20 @@ namespace AyaNova.PlugIn.V8
|
|||||||
if (password == null)
|
if (password == null)
|
||||||
password = login;
|
password = login;
|
||||||
|
|
||||||
dynamic creds = new JObject();
|
dynamic creds = new JObject();
|
||||||
creds.login = login;
|
creds.login = login;
|
||||||
creds.password = password;
|
creds.password = password;
|
||||||
|
|
||||||
ApiResponse a = await PostAsync("Auth", creds.ToString());
|
ApiResponse a = await PostAsync("Auth", creds.ToString());
|
||||||
|
|
||||||
if (a.HttpResponse.IsSuccessStatusCode)
|
if (a.HttpResponse.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
JWT=a.ObjectResponse["data"]["token"].Value<string>();
|
JWT = a.ObjectResponse["data"]["token"].Value<string>();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -179,6 +181,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
return JObject.Parse(jsonString);
|
return JObject.Parse(jsonString);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
|
|||||||
Reference in New Issue
Block a user