Files
textdecalURP/Packages/com.unity.asset-store-tools/Editor/Api/SessionAuthentication.cs
Kirill Chikalin 275dc598c7 update libs
2025-02-13 17:48:12 +03:00

25 lines
823 B
C#

using AssetStoreTools.Api.Responses;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace AssetStoreTools.Api
{
internal class SessionAuthentication : AuthenticationBase
{
public SessionAuthentication(string sessionId)
{
AuthenticationContent = GetAuthenticationContent(
new KeyValuePair<string, string>("reuse_session", sessionId)
);
}
public override async Task<AuthenticationResponse> Authenticate(IAssetStoreClient client, CancellationToken cancellationToken)
{
var result = await client.Post(LoginUrl, AuthenticationContent, cancellationToken);
cancellationToken.ThrowIfCancellationRequested();
return ParseResponse(result);
}
}
}