missing code param err

This commit is contained in:
Lee 2024-06-28 03:13:54 +01:00
parent bf6bd8080d
commit 53b84a884c

@ -146,10 +146,13 @@ public class SpotifyService {
*/ */
@SneakyThrows @SneakyThrows
public String authorize(String code) { public String authorize(String code) {
if (code == null) {
return "Missing code param";
}
AuthorizationCodeCredentials credentials = spotifyApi.authorizationCode(code).build().execute(); AuthorizationCodeCredentials credentials = spotifyApi.authorizationCode(code).build().execute();
String key = StringUtils.randomString(16); String key = StringUtils.randomString(16);
accessToken.put(key, credentials); accessToken.put(key, credentials);
return "Authorization key: " + key; return "Authorization Key: " + key;
} }
/** /**