Skip to content

Commit ec5d5af

Browse files
Merge master into feature/amazonqLSP
2 parents 0a597bd + 39473b7 commit ec5d5af

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/core/src/test/setupUtil.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,16 @@ export function registerAuthHook(secret: string, lambdaId = process.env['AUTH_UT
223223

224224
const openStub = patchObject(vscode.env, 'openExternal', async (target) => {
225225
try {
226-
const url = new URL(target.toString(true))
227-
const userCode = url.searchParams.get('user_code')
226+
// Latest eg: 'https://nkomonen.awsapps.com/start/#/device?user_code=JXZC-NVRK'
227+
const urlString = target.toString(true)
228228

229-
// TODO: Update this to just be the full URL if the authorizer lambda ever
230-
// supports the verification URI with user code embedded (VerificationUriComplete).
231-
const verificationUri = url.origin
229+
// Drop the user_code parameter since the auth lambda does not support it yet, and keeping it
230+
// would trigger a slightly different UI flow which breaks the automation.
231+
// TODO: If the auth lambda supports user_code in the parameters then we can skip this step
232+
const verificationUri = urlString.split('?')[0]
233+
234+
const params = urlString.split('?')[1]
235+
const userCode = new URLSearchParams(params).get('user_code')
232236

233237
await invokeLambda(lambdaId, {
234238
secret,

0 commit comments

Comments
 (0)