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.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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. }