Skip to content

Commit 738ab79

Browse files
Add mode to the notification (microsoft#180977)
ref microsoft#180803 (comment)
1 parent 74d91b8 commit 738ab79

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

extensions/github-authentication/src/githubServer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ export class GitHubServer implements IGitHubServer {
129129
let userCancelled: boolean | undefined;
130130
const yes = vscode.l10n.t('Yes');
131131
const no = vscode.l10n.t('No');
132-
const promptToContinue = async () => {
132+
const promptToContinue = async (mode: string) => {
133133
if (userCancelled === undefined) {
134134
// We haven't had a failure yet so wait to prompt
135135
return;
136136
}
137137
const message = userCancelled
138-
? vscode.l10n.t('Having trouble logging in? Would you like to try a different way?')
139-
: vscode.l10n.t('You have not yet finished authorizing this extension to use GitHub. Would you like to keep trying?');
138+
? vscode.l10n.t('Having trouble logging in? Would you like to try a different way? ({0})', mode)
139+
: vscode.l10n.t('You have not yet finished authorizing this extension to use GitHub. Would you like to try a different way? ({0})', mode);
140140
const result = await vscode.window.showWarningMessage(message, yes, no);
141141
if (result !== yes) {
142142
throw new Error(CANCELLATION_ERROR);
@@ -167,7 +167,7 @@ export class GitHubServer implements IGitHubServer {
167167
supportedTarget
168168
) {
169169
try {
170-
await promptToContinue();
170+
await promptToContinue(vscode.l10n.t('local server'));
171171
return await this.doLoginWithLocalServer(scopes);
172172
} catch (e) {
173173
userCancelled = this.processLoginError(e);
@@ -177,7 +177,7 @@ export class GitHubServer implements IGitHubServer {
177177
// We only can use the Device Code flow when we have a full node environment because of CORS.
178178
if (typeof navigator === 'undefined') {
179179
try {
180-
await promptToContinue();
180+
await promptToContinue(vscode.l10n.t('device code'));
181181
return await this.doLoginDeviceCodeFlow(scopes);
182182
} catch (e) {
183183
userCancelled = this.processLoginError(e);
@@ -188,7 +188,7 @@ export class GitHubServer implements IGitHubServer {
188188
// With that said, GitHub Enterprise isn't used by Settings Sync so we can use PATs for that.
189189
if (!supportedClient || this._type === AuthProviderType.githubEnterprise) {
190190
try {
191-
await promptToContinue();
191+
await promptToContinue(vscode.l10n.t('personal access token'));
192192
return await this.doLoginWithPat(scopes);
193193
} catch (e) {
194194
userCancelled = this.processLoginError(e);

0 commit comments

Comments
 (0)