Skip to content

Commit

Permalink
Merge branch 'next' into pre-release/sept-week2
Browse files Browse the repository at this point in the history
Signed-off-by: Billie Simmons <BillieJean.Simmons@ibm.com>
  • Loading branch information
JillieBeanSim authored Sep 13, 2024
2 parents 776ffbc + 8146202 commit f5c675a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen

### Bug fixes

- Fix issue with outdated SSH credentials stored securely in the SSH profile causing errors. [#2901](https://github.com/zowe/zowe-explorer-vscode/issues/2901)

## `3.0.0-next.202409091409`

### Bug fixes
Expand Down
6 changes: 4 additions & 2 deletions packages/zowe-explorer/src/commands/UnixCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class UnixCommandHandler extends ZoweCommandProvider {
comment: ["Profile type"],
})
);
this.serviceProf = undefined;
return;
}
try {
Expand Down Expand Up @@ -245,7 +246,7 @@ export class UnixCommandHandler extends ZoweCommandProvider {
return;
}
const baseProfile = Constants.PROFILES_CACHE.getDefaultProfile("base");
if (baseProfile.profile.user && baseProfile.profile.password) {
if (baseProfile?.profile?.user && baseProfile?.profile?.password) {
this.sshProfile.profile.user = baseProfile.profile.user;
this.sshProfile.profile.password = baseProfile.profile.password;
}
Expand Down Expand Up @@ -353,6 +354,7 @@ export class UnixCommandHandler extends ZoweCommandProvider {

private async issueCommand(profile: imperative.IProfileLoaded, command: string, cwd: string): Promise<void> {
ZoweLogger.trace("UnixCommandHandler.issueCommand called.");
const profName = this.sshProfile !== undefined ? this.sshProfile.name : profile.name;
try {
if (command) {
const user: string = profile.profile.user;
Expand All @@ -377,7 +379,7 @@ export class UnixCommandHandler extends ZoweCommandProvider {
this.serviceProf = undefined;
}
} catch (error) {
await AuthUtils.errorHandling(error, profile.name);
await AuthUtils.errorHandling(error, profName);
}
}
}
5 changes: 4 additions & 1 deletion packages/zowe-explorer/src/utils/AuthUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export class AuthUtils {
return;
}
}
} else if (httpErrorCode === imperative.RestConstants.HTTP_STATUS_401) {
} else if (
httpErrorCode === imperative.RestConstants.HTTP_STATUS_401 ||
imperativeError.message.includes("All configured authentication methods failed")
) {
const errMsg = vscode.l10n.t({
message:
"Invalid Credentials for profile '{0}'. Please ensure the username and password are valid or this may lead to a lock-out.",
Expand Down

0 comments on commit f5c675a

Please sign in to comment.