mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:16:30 +00:00
do not use Loader to check creds
This commit is contained in:
@@ -3,26 +3,28 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Azaion.LoaderUI;
|
||||
|
||||
public interface IAzaionApi
|
||||
{
|
||||
void Login(ApiCredentials credentials);
|
||||
Task Validate(ApiCredentials credentials);
|
||||
Task<string> GetLastInstallerName(string folder);
|
||||
Task<(string name, Stream stream)> DownloadInstaller(string folder);
|
||||
}
|
||||
|
||||
public class AzaionApi(HttpClient client) : IAzaionApi
|
||||
public class AzaionApi(HttpClient client, ILogger<Login> logger) : IAzaionApi
|
||||
{
|
||||
private string _jwtToken = null!;
|
||||
const string APP_JSON = "application/json";
|
||||
private const string APP_JSON = "application/json";
|
||||
private ApiCredentials _credentials = null!;
|
||||
|
||||
public void Login(ApiCredentials credentials)
|
||||
public async Task Validate(ApiCredentials credentials)
|
||||
{
|
||||
_credentials = credentials;
|
||||
await Get<bool>("/resources/check");
|
||||
}
|
||||
|
||||
public async Task<string> GetLastInstallerName(string folder)
|
||||
|
||||
Reference in New Issue
Block a user