Skip to content

Commit 5c30fc2

Browse files
fix: CC not auto connecting
- CC now auto connects if a connection already exists - Fix the Proceed To Browser message not including the device code since modals dont support 'detail' in C9 Signed-off-by: nkomonen <[email protected]>
1 parent c50147a commit 5c30fc2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/auth/sso/model.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { CancellationError } from '../../shared/utilities/timeoutUtils'
1616
import { ssoAuthHelpUrl } from '../../shared/constants'
1717
import { openUrl } from '../../shared/utilities/vsCodeUtils'
1818
import { ToolkitError } from '../../shared/errors'
19+
import { isCloud9 } from '../../shared/extensionUtilities'
1920

2021
export interface SsoToken {
2122
/**
@@ -117,7 +118,10 @@ export async function openSsoPortalLink(startUrl: string, authorization: Authori
117118

118119
async function showLoginNotification() {
119120
const name = startUrl === builderIdStartUrl ? localizedText.builderId() : localizedText.iamIdentityCenterFull()
120-
const title = localize('AWS.auth.loginWithBrowser.messageTitle', 'Confirm Code for {0}', name)
121+
// C9 doesn't support `detail` field with modals so we need to put it all in the `title`
122+
const title = isCloud9()
123+
? `Confirm Code "${authorization.userCode}" for ${name} in the browser.`
124+
: localize('AWS.auth.loginWithBrowser.messageTitle', 'Confirm Code for {0}', name)
121125
const detail = localize(
122126
'AWS.auth.loginWithBrowser.messageDetail',
123127
'Confirm this code in the browser: {0}',

src/codecatalyst/activation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export async function activate(ctx: ExtContext): Promise<void> {
3535
const commands = new CodeCatalystCommands(authProvider)
3636
const remoteSourceProvider = new CodeCatalystRemoteSourceProvider(commands, authProvider)
3737

38+
await authProvider.restore()
39+
3840
ctx.extensionContext.subscriptions.push(
3941
uriHandlers.register(ctx.uriHandler, CodeCatalystCommands.declared),
4042
...Object.values(CodeCatalystCommands.declared).map(c => c.register(commands)),

0 commit comments

Comments
 (0)