forked from Fascinated/Bat
add configurable redirect uri
This commit is contained in:
@ -24,8 +24,6 @@ import java.util.concurrent.TimeUnit;
|
||||
@Service
|
||||
@Getter
|
||||
public class SpotifyService {
|
||||
private static final String REDIRECT_URI = "http://localhost:8080/spotify/callback";
|
||||
|
||||
/**
|
||||
* The access token map.
|
||||
*/
|
||||
@ -58,7 +56,8 @@ public class SpotifyService {
|
||||
*/
|
||||
private final String authorizationUrl;
|
||||
|
||||
public SpotifyService(@Value("${spotify.client-id}") String clientId, @Value("${spotify.client-secret}") String clientSecret, @NonNull UserService userService) {
|
||||
public SpotifyService(@Value("${spotify.client-id}") String clientId, @Value("${spotify.client-secret}") String clientSecret,
|
||||
@Value("${spotify.redirect-uri}") String redirectUri, @NonNull UserService userService) {
|
||||
this.clientId = clientId;
|
||||
this.clientSecret = clientSecret;
|
||||
this.userService = userService;
|
||||
@ -66,7 +65,7 @@ public class SpotifyService {
|
||||
this.spotifyApi = new SpotifyApi.Builder()
|
||||
.setClientId(clientId)
|
||||
.setClientSecret(clientSecret)
|
||||
.setRedirectUri(URI.create(REDIRECT_URI))
|
||||
.setRedirectUri(URI.create(redirectUri))
|
||||
.build();
|
||||
this.authorizationUrl = spotifyApi.authorizationCodeUri()
|
||||
.response_type("code")
|
||||
|
Reference in New Issue
Block a user