Skip to content

Commit 18a3c44

Browse files
committed
Review comments
1 parent 065bc77 commit 18a3c44

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@
289289
},
290290
{
291291
"command": "coder.manageCredentials",
292-
"title": "Manage Stored Credentials",
292+
"title": "Manage Credentials",
293293
"category": "Coder"
294294
}
295295
],

src/commands.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { type PathResolver } from "./core/pathResolver";
1717
import { type SecretsManager } from "./core/secretsManager";
1818
import { type DeploymentManager } from "./deployment/deploymentManager";
1919
import { CertificateError } from "./error/certificateError";
20+
import { toError } from "./error/errorUtils";
2021
import { type Logger } from "./logging/logger";
2122
import { type LoginCoordinator } from "./login/loginCoordinator";
2223
import { maybeAskAgent, maybeAskUrl } from "./promptUtils";
@@ -258,7 +259,7 @@ export class Commands {
258259
const items: Array<{
259260
label: string;
260261
description: string;
261-
hostname: string | undefined;
262+
hostname: string | null;
262263
}> = hostnames.map((hostname) => ({
263264
label: `$(key) ${hostname}`,
264265
description: "Remove stored credentials",
@@ -270,7 +271,7 @@ export class Commands {
270271
items.push({
271272
label: "$(trash) Remove All",
272273
description: `Remove credentials for all ${hostnames.length} deployments`,
273-
hostname: undefined,
274+
hostname: null,
274275
});
275276
}
276277

@@ -285,6 +286,7 @@ export class Commands {
285286

286287
if (selected.hostname) {
287288
await this.secretsManager.clearAllAuthData(selected.hostname);
289+
this.logger.info("Removed credentials for", selected.hostname);
288290
vscode.window.showInformationMessage(
289291
`Removed credentials for ${selected.hostname}`,
290292
);
@@ -302,6 +304,10 @@ export class Commands {
302304
await Promise.all(
303305
hostnames.map((h) => this.secretsManager.clearAllAuthData(h)),
304306
);
307+
this.logger.info(
308+
"Removed credentials for all deployments:",
309+
hostnames.join(", "),
310+
);
305311
vscode.window.showInformationMessage(
306312
"Removed credentials for all deployments",
307313
);
@@ -310,7 +316,7 @@ export class Commands {
310316
} catch (error: unknown) {
311317
this.logger.error("Failed to manage stored credentials", error);
312318
vscode.window.showErrorMessage(
313-
"Failed to manage stored credentials. Storage may be corrupted.",
319+
`Failed to manage stored credentials: ${toError(error).message}`,
314320
);
315321
}
316322
}

0 commit comments

Comments
 (0)