This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<LangVersion>12</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="RestSharp" Version="110.2.0" />
|
||||
<PackageReference Include="RestSharp" Version="112.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -29,13 +29,19 @@ namespace LaDOSE.REST
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void Connect(Uri url, string user, string password)
|
||||
public RestService(Uri url, string user, string password)
|
||||
{
|
||||
Client = new RestClient(url);
|
||||
this.username = user;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public void Connect(Uri url, string user, string password)
|
||||
{
|
||||
// Client = new RestClient(url);
|
||||
// this.username = user;
|
||||
// this.password = password;
|
||||
string token;
|
||||
try
|
||||
{
|
||||
@@ -79,7 +85,7 @@ namespace LaDOSE.REST
|
||||
|
||||
private void CheckToken()
|
||||
{
|
||||
if (this.Auth == null || this.Auth.Expire <= DateTime.Now)
|
||||
if (this.Auth == null || this.Auth.Expire.ToUniversalTime() <= DateTime.Now.ToUniversalTime())
|
||||
{
|
||||
GetToken(this.username,this.password);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user