Files
YandexMusic/YandexMusic.API/Requests/Account/YGetAuthLetterBuilder.cs
2026-04-10 12:12:33 +03:00

30 lines
987 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Net;
using YandexMusic.API.Common;
using YandexMusic.API.Requests.Common;
using YandexMusic.API.Requests.Common.Attributes;
namespace YandexMusic.API.Requests.Account
{
[YPassportRequest(WebRequestMethods.Http.Post, "registration-validations/auth/send_magic_letter")]
internal class YGetAuthLetterBuilder : YRequestBuilder<Models.Account.YAuthLetter, string>
{
public YGetAuthLetterBuilder(YandexMusicApi yandex, AuthStorage auth) : base(yandex, auth)
{
}
protected override HttpContent GetContent(string tuple)
{
if (storage.AuthToken == null)
{
throw new Exception("Не найдена сессия входа.");
}
return new FormUrlEncodedContent(new Dictionary<string, string>
{
{ "csrf_token", storage.AuthToken.CsfrToken },
{ "track_id", storage.AuthToken.TrackId },
});
}
}
}