Skip to content

Commit

Permalink
feat: add some logging to $auth replacement (AnWeber/vscode-httpyac#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnWeber committed Aug 22, 2024
1 parent aeb376a commit d1628a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/intellij/replacer/replaceIntellijVariableAuth.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -109,7 +109,7 @@ function mapGrantType(
}

interface IntellijSecurity {
Auth?: Record<
Auth: Record<
string,
{
Type: 'OAuth2' | 'Mock';
Expand Down

0 comments on commit d1628a5

Please sign in to comment.