mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-25 15:36:26 +00:00
9f6729ad60
Disabled examples for now
34 lines
1006 B
C#
34 lines
1006 B
C#
using System.Diagnostics;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Authentication;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SpotifyAPI.Web.Examples.ASP.Models;
|
|
|
|
namespace SpotifyAPI.Web.Examples.ASP.Controllers
|
|
{
|
|
[Authorize(AuthenticationSchemes = "Spotify")]
|
|
public class HomeController : Controller
|
|
{
|
|
public IActionResult Index()
|
|
{
|
|
// var accessToken = await HttpContext.GetTokenAsync("Spotify", "access_token");
|
|
// SpotifyWebAPI api = new SpotifyWebAPI
|
|
// {
|
|
// AccessToken = accessToken,
|
|
// TokenType = "Bearer"
|
|
// };
|
|
|
|
// var savedTracks = await api.GetSavedTracksAsync(50);
|
|
|
|
return View(new IndexModel { SavedTracks = null });
|
|
}
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
public IActionResult Error()
|
|
{
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
}
|
|
}
|
|
}
|