diff --git a/packages/plugin-ext/src/main/browser/authentication-main.ts b/packages/plugin-ext/src/main/browser/authentication-main.ts index 087b1c0893177..ac39dcb52e41a 100644 --- a/packages/plugin-ext/src/main/browser/authentication-main.ts +++ b/packages/plugin-ext/src/main/browser/authentication-main.ts @@ -24,7 +24,7 @@ import { interfaces } from '@theia/core/shared/inversify'; import { AuthenticationExt, AuthenticationMain, MAIN_RPC_CONTEXT } from '../../common/plugin-api-rpc'; import { RPCProtocol } from '../../common/rpc-protocol'; import { MessageService } from '@theia/core/lib/common/message-service'; -import { Dialog, StorageService } from '@theia/core/lib/browser'; +import { ConfirmDialog, Dialog, StorageService } from '@theia/core/lib/browser'; import { AuthenticationProvider, AuthenticationService, @@ -199,13 +199,18 @@ export class AuthenticationMainImpl implements AuthenticationMain { } protected async loginPrompt(providerName: string, extensionName: string, recreatingSession: boolean, detail?: string): Promise { - let message = recreatingSession + const msg = document.createElement('span'); + msg.textContent = recreatingSession ? nls.localizeByDefault("The extension '{0}' wants you to sign in again using {1}.", extensionName, providerName) : nls.localizeByDefault("The extension '{0}' wants to sign in using {1}.", extensionName, providerName); - message = detail ? message + ' ' + detail : message; - const choice = await this.messageService.info(message, 'Allow', 'Cancel'); - return choice === 'Allow'; + if (detail) { + const detailElement = document.createElement('p'); + detailElement.textContent = detail; + msg.appendChild(detailElement); + } + + return !!await new ConfirmDialog({ title: '', msg, ok: nls.localizeByDefault('Allow'), cancel: Dialog.CANCEL }).open(); } protected async isAccessAllowed(providerId: string, accountName: string, extensionId: string): Promise {