fix(core): Use correct scopes-separator when generating authorization urls (#6502)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-06-21 15:19:38 +02:00
committed by GitHub
parent 6ab350209d
commit 5bf83f8bf6
8 changed files with 53 additions and 57 deletions

View File

@@ -1,7 +1,7 @@
import type { ClientOAuth2, ClientOAuth2Options } from './ClientOAuth2';
import type { ClientOAuth2Token, ClientOAuth2TokenData } from './ClientOAuth2Token';
import { DEFAULT_HEADERS } from './constants';
import { auth, expects, getRequestOptions, sanitizeScope } from './utils';
import { auth, expects, getRequestOptions } from './utils';
interface CredentialsFlowBody {
grant_type: 'client_credentials';
@@ -29,7 +29,7 @@ export class CredentialsFlow {
};
if (options.scopes !== undefined) {
body.scope = sanitizeScope(options.scopes);
body.scope = options.scopes.join(options.scopesSeparator ?? ' ');
}
const requestOptions = getRequestOptions(