You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var authorization:SpotifyUserAuthorization=SpotifyUserAuthorizationBuilder().build()
@@ -239,9 +239,11 @@ class SpotifyClientApiBuilder(
239
239
val clientSecret = credentials.clientSecret
240
240
val redirectUri = credentials.redirectUri
241
241
242
-
require(clientId !=null&& clientSecret !=null&& redirectUri !=null) { "You need to specify a valid clientId, clientSecret, and redirectUri in the credentials block!" }
242
+
require((clientId !=null&& clientSecret !=null&& redirectUri!=null) || authorization.token !=null|| authorization.tokenString!=null) { "You need to specify a valid clientId, clientSecret, and redirectUri in the credentials block!" }
243
243
returnwhen {
244
244
authorization.authorizationCode !=null->try {
245
+
require(clientId !=null&& clientSecret !=null&& redirectUri !=null) { "You need to specify a valid clientId, clientSecret, and redirectUri in the credentials block!" }
246
+
245
247
val response = executeTokenRequest(
246
248
HttpConnection(
247
249
"https://accounts.spotify.com/api/token",
@@ -274,9 +276,9 @@ class SpotifyClientApiBuilder(
274
276
throwSpotifyException("Invalid credentials provided in the login process", e)
275
277
}
276
278
authorization.token !=null->SpotifyClientApi(
277
-
clientId?:"",
278
-
clientSecret?:"",
279
-
redirectUri?:"",
279
+
clientId,
280
+
clientSecret,
281
+
redirectUri,
280
282
authorization.token!!,
281
283
options.useCache,
282
284
options.cacheLimit,
@@ -286,9 +288,9 @@ class SpotifyClientApiBuilder(
0 commit comments