From d1628a5eef9f2a6f8468f5bb9b597b705cca46f0 Mon Sep 17 00:00:00 2001 From: Andreas Weber Date: Thu, 22 Aug 2024 15:36:06 +0200 Subject: [PATCH] feat: add some logging to $auth replacement (Anweber/vscode-httpyac#309) --- .../intellij/replacer/replaceIntellijVariableAuth.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/intellij/replacer/replaceIntellijVariableAuth.ts b/src/plugins/intellij/replacer/replaceIntellijVariableAuth.ts index 69058851..2b142635 100644 --- a/src/plugins/intellij/replacer/replaceIntellijVariableAuth.ts +++ b/src/plugins/intellij/replacer/replaceIntellijVariableAuth.ts @@ -1,6 +1,7 @@ import { OpenIdConfiguration, ProcessorContext, Variables } from '../../../models'; import { getOAuth2Response } from '../../oauth2'; import { setVariableInContext } from '../../../utils'; +import { log } from '../../../io'; export async function replaceIntellijVariableAuth( variable: string, context: ProcessorContext @@ -41,13 +42,12 @@ async function getOAuthToken(variable: string, context: ProcessorContext) { function getOpenIdConfiguration(name: string, variables: Variables) { if (!isIntellijAuth(variables.Security)) { - return undefined; - } - if (!variables.Security?.Auth) { + log.warn('no intellij auth security found'); return undefined; } const auth = variables.Security?.Auth?.[name]; if (!auth) { + log.warn(`no auth security found with name ${name}`); return undefined; } @@ -109,7 +109,7 @@ function mapGrantType( } interface IntellijSecurity { - Auth?: Record< + Auth: Record< string, { Type: 'OAuth2' | 'Mock';