Пример #1
0
 public async Task RefreshTokenForUserAsync(string partyGoerId)
 {
     if (await _spotifyAuthentication.DoesAccessTokenNeedRefreshAsync(partyGoerId))
     {
         await RequestNewAccessToken(_spotifyAuthentication.GetRefreshTokenForPartyGoer(partyGoerId));
     }
 }
Пример #2
0
        public async Task <string> GetPartyGoerAccessTokenAsync(PartyGoer partyGoer)
        {
            if (await _spotifyAuthentication.DoesAccessTokenNeedRefreshAsync(partyGoer.GetId()))
            {
                await _spotifyHttpClient.RefreshTokenForUserAsync(partyGoer.GetId());
            }

            return(await _spotifyAuthentication.GetAccessTokenAsync(partyGoer));
        }