Переделан способ авторизации по qr
All checks were successful
Release / pack-and-publish (release) Successful in 1m5s
All checks were successful
Release / pack-and-publish (release) Successful in 1m5s
This commit is contained in:
23
YandexMusic.API/Requests/Account/YPostQrStatus.cs
Normal file
23
YandexMusic.API/Requests/Account/YPostQrStatus.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using YandexMusic.API.Models.Account;
|
||||
|
||||
namespace YandexMusic.API.Requests.Account;
|
||||
|
||||
internal class YPostQrStatus : YAuthRequestBuilder<YAuthQRStatus?, object>
|
||||
{
|
||||
public YPostQrStatus(YandexMusicApi api) : base(api) { }
|
||||
protected override string Method => WebRequestMethods.Http.Post;
|
||||
protected override string PathTemplate => "pwl-yandex/api/passport/auth/magic/code/status";
|
||||
protected override HttpContent? GetContent(object _)
|
||||
=> new FormUrlEncodedContent(new Dictionary<string, string>
|
||||
{
|
||||
["csrf_token"] = Api.Storage.AuthToken.CsfrToken,
|
||||
["track_id"] = Api.Storage.AuthToken.TrackId,
|
||||
});
|
||||
protected override void SetCustomHeaders(HttpRequestHeaders headers)
|
||||
{
|
||||
headers.Add("X-Csrf-Token", Api.Storage.HeaderToken.CsfrToken);
|
||||
headers.Add("Process-Uuid", Api.Storage.HeaderToken.ProcessUuid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user