Blazor & WASM in combination to get statistics from Spotify API for performing the song analysis. With separate microservices for auth, Spotify, user data tracking, and application, connected through gRPC with Polly.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

SpotifyHelper.cs 669B

123456789101112131415161718192021
  1. using Blazored.LocalStorage;
  2. using GrpcShared.DTO;
  3. using NemAnBlazor.Services.Interfaces;
  4. namespace NemAnBlazor
  5. {
  6. public static class SpotifyHelper
  7. {
  8. public static async Task<string?> TryRefreshToken(IAuthClientService authService, TokenMessage msg, ILocalStorageService localStorage)
  9. {
  10. var refreshResponse = await authService.RefreshAccessToken(msg);
  11. if (refreshResponse.AccessToken != null)
  12. {
  13. await localStorage.SetItemAsync<string>("token", refreshResponse.AccessToken);
  14. return refreshResponse.AccessToken;
  15. }
  16. else return null;
  17. }
  18. }
  19. }