From 31c9a2aa576a4d2541273e4f720a959479faefa7 Mon Sep 17 00:00:00 2001 From: shabinder Date: Tue, 16 Mar 2021 19:44:45 +0530 Subject: [PATCH] Spotify Auth Fix for web --- .../com/shabinder/common/di/providers/SpotifyProvider.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/dependency-injection/src/commonMain/kotlin/com/shabinder/common/di/providers/SpotifyProvider.kt b/common/dependency-injection/src/commonMain/kotlin/com/shabinder/common/di/providers/SpotifyProvider.kt index c99708c0..d49a2a32 100644 --- a/common/dependency-injection/src/commonMain/kotlin/com/shabinder/common/di/providers/SpotifyProvider.kt +++ b/common/dependency-injection/src/commonMain/kotlin/com/shabinder/common/di/providers/SpotifyProvider.kt @@ -20,6 +20,7 @@ import co.touchlab.kermit.Kermit import com.shabinder.common.di.* import com.shabinder.common.di.spotify.SpotifyRequests import com.shabinder.common.di.spotify.authenticateSpotify +import com.shabinder.common.models.AllPlatforms import com.shabinder.common.models.PlatformQueryResult import com.shabinder.common.models.TrackDetails import com.shabinder.common.models.spotify.Album @@ -43,7 +44,9 @@ class SpotifyProvider( init { logger.d { "Creating Spotify Provider" } GlobalScope.launch(Dispatchers.Default) { - authenticateSpotifyClient() + if(currentPlatform is AllPlatforms.Js){ + authenticateSpotifyClient(override = true) + }else authenticateSpotifyClient() } }