fix access token refreshing?!??!
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 52s

This commit is contained in:
Lee 2024-07-06 04:18:10 +01:00
parent 98e9003129
commit 6de1e8b2b1

@ -188,7 +188,8 @@ public class SpotifyService {
*/
@SneakyThrows
public void ensureValidToken(SpotifyProfile profile, BatUser user) {
if (profile.getExpiresAt() == null || profile.getExpiresAt() < System.currentTimeMillis()) {
// If the token is still valid, return
if (profile.getExpiresAt() > System.currentTimeMillis()) {
return;
}
SpotifyApi api = new SpotifyApi.Builder()