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