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文字以内のものにしてください。

Callback.razor 963B

123456789101112131415161718192021222324252627282930313233
  1. @page "/callback"
  2. @using NemAnBlazor.Services.Interfaces
  3. @inject NavigationManager NavigationMgr
  4. @inject IAuthClientService AuthService
  5. @inject Blazored.SessionStorage.ISessionStorageService sessionStorage
  6. <PageTitle>Redirecting...</PageTitle>
  7. <p role="status">Loading...</p>
  8. @code {
  9. protected override async Task OnInitializedAsync()
  10. {
  11. string url = NavigationMgr.Uri;
  12. //code is the only parameter in the url
  13. string code = url.Split("=")[1];
  14. var response = await AuthService.GetAccessToken(new GrpcShared.DTO.Auth.TokenRequest { Code = code});
  15. //if (response.access_token == null) NavigationMgr.NavigateTo("/");
  16. //store access token in local storage
  17. await sessionStorage.SetItemAsync("token", response.AccessToken);
  18. await sessionStorage.SetItemAsync("refresh_token", response.RefreshToken);
  19. //redirect to home
  20. NavigationMgr.NavigateTo("/home");
  21. }
  22. }