fix(core): Allow ignoring SSL issues on generic oauth2 credentials (#6702)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-07-26 17:56:59 +02:00
committed by GitHub
parent db3c12ffc7
commit feac369f6c
8 changed files with 36 additions and 8 deletions

View File

@@ -53,13 +53,13 @@ export class CodeFlow {
* the user access token.
*/
async getToken(
uri: string | URL,
urlString: string,
opts?: Partial<ClientOAuth2Options>,
): Promise<ClientOAuth2Token> {
const options = { ...this.client.options, ...opts };
const options: ClientOAuth2Options = { ...this.client.options, ...opts };
expects(options, 'clientId', 'accessTokenUri');
const url = uri instanceof URL ? uri : new URL(uri, DEFAULT_URL_BASE);
const url = new URL(urlString, DEFAULT_URL_BASE);
if (
typeof options.redirectUri === 'string' &&
typeof url.pathname === 'string' &&
@@ -70,7 +70,7 @@ export class CodeFlow {
if (!url.search?.substring(1)) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
throw new TypeError(`Unable to process uri: ${uri.toString()}`);
throw new TypeError(`Unable to process uri: ${urlString}`);
}
const data =