public async Task RefreshTokenForUserAsync(string partyGoerId) { if (await _spotifyAuthentication.DoesAccessTokenNeedRefreshAsync(partyGoerId)) { await RequestNewAccessToken(_spotifyAuthentication.GetRefreshTokenForPartyGoer(partyGoerId)); } }
public async Task <string> GetPartyGoerAccessTokenAsync(PartyGoer partyGoer) { if (await _spotifyAuthentication.DoesAccessTokenNeedRefreshAsync(partyGoer.GetId())) { await _spotifyHttpClient.RefreshTokenForUserAsync(partyGoer.GetId()); } return(await _spotifyAuthentication.GetAccessTokenAsync(partyGoer)); }