Skip to content

Commit d8fdb25

Browse files
committed
Fix getMfaCode request handler types
1 parent a6d98d3 commit d8fdb25

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ async function postStartLanguageServer(
346346
)
347347

348348
// Handler for when Flare needs to assume a role with MFA code
349-
client.onRequest<GetMfaCodeParams, GetMfaCodeResult>(
350-
getMfaCodeRequestType.method,
349+
client.onRequest(
350+
auth2.notificationTypes.getMfaCode.method,
351351
async (params: GetMfaCodeParams): Promise<GetMfaCodeResult> => {
352352
const mfaCode = await vscode.window.showInputBox({ title: 'Enter MFA Code' })
353353
return { code: mfaCode ?? '' }

packages/core/src/auth/auth2.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ import {
4949
iamCredentialsUpdateRequestType,
5050
Profile,
5151
SsoSession,
52+
GetMfaCodeParams,
53+
getMfaCodeRequestType,
54+
5255
} from '@aws/language-server-runtimes/protocol'
5356
import { LanguageClient } from 'vscode-languageclient'
5457
import { getLogger } from '../shared/logger/logger'
@@ -70,6 +73,9 @@ export const notificationTypes = {
7073
getConnectionMetadata: new RequestType<undefined, ConnectionMetadata, Error>(
7174
getConnectionMetadataRequestType.method
7275
),
76+
getMfaCode: new RequestType<GetMfaCodeParams, ResponseMessage, Error>(
77+
getMfaCodeRequestType.method
78+
)
7379
}
7480

7581
export type AuthState = 'notConnected' | 'connected' | 'expired'

0 commit comments

Comments
 (0)