Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions packages/core/src/test/setupUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,23 @@ export function registerAuthHook(secret: string, lambdaId = process.env['AUTH_UT

const openStub = patchObject(vscode.env, 'openExternal', async (target) => {
try {
const url = new URL(target.toString(true))
const userCode = url.searchParams.get('user_code')

// TODO: Update this to just be the full URL if the authorizer lambda ever
// supports the verification URI with user code embedded (VerificationUriComplete).
const verificationUri = url.origin

await invokeLambda(lambdaId, {
secret,
userCode,
verificationUri,
})
throw new Error(`Auth URL: ${target.toString(true)}`)
// const url = new URL(target.toString(true))
//
// // A `#` was added in to the URL path and broke the parsing, so we need to drop the '#'
// // Eg: 'https://nkomonen.awsapps.com/start/#/device?user_code=JXZC-NVRK'
// const urlWithoutHash = target.toString(true).replace(/\/\#/, '')
// const userCode = new URL(urlWithoutHash).searchParams.get('user_code')
//
// // TODO: Update this to just be the full URL if the authorizer lambda ever
// // supports the verification URI with user code embedded (VerificationUriComplete).
// const verificationUri = url.origin
//
// await invokeLambda(lambdaId, {
// secret,
// userCode,
// verificationUri,
// })
} finally {
openStub.dispose()
}
Expand Down
Loading