Skip to content

Commit

Permalink
Update SpotifyOAuth2Provider.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Sep 16, 2023
1 parent f7f527b commit da7c60c
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions MusicTypeChat/SpotifyOAuth2Provider.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Security.Cryptography;
using System.Text;
using System.Text.Json.Nodes;
using System.Text;
using ServiceStack.Auth;

namespace MusicTypeChat;
Expand Down Expand Up @@ -63,19 +61,12 @@ protected override async Task<string> GetAccessTokenJsonAsync(string code, AuthC
var base64String = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{ConsumerKey}:{ConsumerSecret}"));

var contents = await url.PostToUrlAsync(payload,
responseFilter: (res) =>
{
// Log details
Console.WriteLine($"Response Status Code: {res.StatusCode}");
Console.WriteLine($"Response Status Description: {res.ReasonPhrase}");
},
requestFilter: req => req.Headers.Add("Authorization", $"Basic {base64String}"),
token: token).ConfigAwait();

return contents;
}


protected override async Task<Dictionary<string, string>> CreateAuthInfoAsync(string accessToken,
CancellationToken token = new())
{
Expand Down

0 comments on commit da7c60c

Please sign in to comment.