Skip to content

Commit

Permalink
To use securePropsForProfile() method
Browse files Browse the repository at this point in the history
Signed-off-by: Santhoshi Boyina <Santhoshi.Boyina1@ibm.com>
  • Loading branch information
SanthoshiBoyina1 committed Jul 2, 2024
1 parent 883e507 commit 36564e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/zowe-explorer/src/Profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,8 @@ export class Profiles extends ProfilesCache {
public async basicAuthClearSecureArray(profileName?: string): Promise<void> {
const profAttrs = await this.getProfileFromConfig(profileName);
const configApi = (await this.getProfileInfo()).getTeamConfig();
configApi.set(`${profAttrs.profLoc.jsonLoc}.secure`, ["tokenValue"]);
const secureProps = await this.getSecurePropsForProfile(profileName);
configApi.set(`${secureProps.toString()}`, ["tokenValue"]);
configApi.delete(`${profAttrs.profLoc.jsonLoc}.properties.user`);
configApi.delete(`${profAttrs.profLoc.jsonLoc}.properties.password`);
await configApi.save();
Expand All @@ -1250,7 +1251,8 @@ export class Profiles extends ProfilesCache {
public async tokenAuthClearSecureArray(profileName?: string): Promise<void> {
const profAttrs = await this.getProfileFromConfig(profileName);
const configApi = (await this.getProfileInfo()).getTeamConfig();
configApi.set(`${profAttrs.profLoc.jsonLoc}.secure`, ["user", "password"]);
const secureProps = await this.getSecurePropsForProfile(profileName);
configApi.set(`${secureProps.toString()}`, ["user", "password"]);
configApi.delete(`${profAttrs.profLoc.jsonLoc}.properties.tokenType`);
configApi.delete(`${profAttrs.profLoc.jsonLoc}.properties.tokenValue`);
configApi.delete(`${profAttrs.profLoc.jsonLoc}.properties.tokenExpiration`);
Expand Down

0 comments on commit 36564e9

Please sign in to comment.