Sets the authentication tokens and calculates expiry time
Access token from Spotify
Refresh token from Spotify
Token expiry time in seconds
export function setTokens( newAccessToken: string, newRefreshToken: string, expiresIn: number,): void { accessToken = newAccessToken; refreshToken = newRefreshToken; tokenExpiryTime = Date.now() + expiresIn * 1000; saveLog(`Spotify tokens updated, expires in ${expiresIn} seconds`, "DEBUG");} Copy
export function setTokens( newAccessToken: string, newRefreshToken: string, expiresIn: number,): void { accessToken = newAccessToken; refreshToken = newRefreshToken; tokenExpiryTime = Date.now() + expiresIn * 1000; saveLog(`Spotify tokens updated, expires in ${expiresIn} seconds`, "DEBUG");}
Sets the authentication tokens and calculates expiry time