diff --git a/src/SpotifyApi.ts b/src/SpotifyApi.ts index cc34386..72a9770 100644 --- a/src/SpotifyApi.ts +++ b/src/SpotifyApi.ts @@ -169,8 +169,8 @@ export class SpotifyApi { return new SpotifyApi(strategy, config); } - public static withClientCredentials(clientId: string, clientSecret: string, scopes: string[] = [], config?: SdkOptions): SpotifyApi { - const strategy = new ClientCredentialsStrategy(clientId, clientSecret, scopes); + public static withClientCredentials(clientId: string, clientSecret: string, config?: SdkOptions): SpotifyApi {//change + const strategy = new ClientCredentialsStrategy(clientId, clientSecret); return new SpotifyApi(strategy, config); } diff --git a/src/auth/ClientCredentialsStrategy.ts b/src/auth/ClientCredentialsStrategy.ts index 414e049..11ffc7d 100644 --- a/src/auth/ClientCredentialsStrategy.ts +++ b/src/auth/ClientCredentialsStrategy.ts @@ -10,8 +10,7 @@ export default class ClientCredentialsStrategy implements IAuthStrategy { constructor( private clientId: string, - private clientSecret: string, - private scopes: string[] = [] + private clientSecret: string ) { } @@ -46,8 +45,7 @@ export default class ClientCredentialsStrategy implements IAuthStrategy { private async getTokenFromApi(): Promise { const options = { - grant_type: 'client_credentials', - scope: this.scopes.join(' ') + grant_type: 'client_credentials' } as any; const bodyAsString = Object.keys(options).map(key => key + '=' + options[key]).join('&');