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.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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