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
@@ -250,41 +272,42 @@ class SpotifyClientApiBuilder(
250
272
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!" }
251
273
returnwhen {
252
274
authorization.authorizationCode !=null->try {
253
-
require(clientId !=null&& clientSecret !=null&& redirectUri !=null) { "You need to specify a valid clientId, clientSecret, and redirectUri in the credentials block!" }
254
-
255
-
val response = executeTokenRequest(
256
-
HttpConnection(
257
-
"https://accounts.spotify.com/api/token",
258
-
HttpRequestMethod.POST,
259
-
mapOf(
260
-
"grant_type" to "authorization_code",
261
-
"code" to authorization.authorizationCode,
262
-
"redirect_uri" to redirectUri
263
-
),
264
-
null,
265
-
"application/x-www-form-urlencoded",
266
-
listOf(),
267
-
null
268
-
), clientId, clientSecret
269
-
)
270
-
271
-
SpotifyClientApi(
272
-
clientId,
273
-
clientSecret,
274
-
redirectUri,
275
-
response.body.toObject(Token.serializer(), null),
276
-
options.useCache,
277
-
options.cacheLimit,
278
-
options.automaticRefresh,
279
-
options.retryWhenRateLimited,
280
-
options.enableLogger,
281
-
options.testTokenValidity
282
-
)
283
-
} catch (e:CancellationException) {
284
-
throw e
285
-
} catch (e:Exception) {
286
-
throwSpotifyAuthenticationException("Invalid credentials provided in the login process", e)
287
-
}
275
+
require(clientId !=null&& clientSecret !=null&& redirectUri !=null) { "You need to specify a valid clientId, clientSecret, and redirectUri in the credentials block!" }
@@ -313,7 +337,8 @@ class SpotifyClientApiBuilder(
313
337
false,
314
338
options.retryWhenRateLimited,
315
339
options.enableLogger,
316
-
options.testTokenValidity
340
+
options.testTokenValidity,
341
+
options.json
317
342
)
318
343
else->throwIllegalArgumentException(
319
344
"At least one of: authorizationCode, tokenString, or token must be provided "+
@@ -338,19 +363,18 @@ class SpotifyAppApiBuilder(
338
363
val clientSecret = credentials.clientSecret
339
364
require((clientId !=null&& clientSecret !=null) || authorization.token !=null|| authorization.tokenString !=null) { "You didn't specify a client id or client secret in the credentials block!" }
0 commit comments