forked from Fascinated/Bat
add log for token refresh in spotify
This commit is contained in:
parent
eccd673db8
commit
e892dade1c
@ -7,6 +7,8 @@ import lombok.Getter;
|
|||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import net.jodah.expiringmap.ExpiringMap;
|
import net.jodah.expiringmap.ExpiringMap;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import se.michaelthelin.spotify.SpotifyApi;
|
import se.michaelthelin.spotify.SpotifyApi;
|
||||||
@ -24,6 +26,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Service
|
@Service
|
||||||
@Getter
|
@Getter
|
||||||
public class SpotifyService {
|
public class SpotifyService {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(SpotifyService.class);
|
||||||
/**
|
/**
|
||||||
* The access token map.
|
* The access token map.
|
||||||
*/
|
*/
|
||||||
@ -198,6 +201,7 @@ public class SpotifyService {
|
|||||||
api.setAccessToken(credentials.getAccessToken());
|
api.setAccessToken(credentials.getAccessToken());
|
||||||
api.setRefreshToken(credentials.getRefreshToken());
|
api.setRefreshToken(credentials.getRefreshToken());
|
||||||
userService.saveUser(user);
|
userService.saveUser(user);
|
||||||
|
log.info("Refreshed spotify access token for user {}", user.getName());
|
||||||
}
|
}
|
||||||
return api;
|
return api;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user