diff --git a/src/extension.ts b/src/extension.ts index cb1ad02e5..1f03b2e4f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -63,13 +63,17 @@ export async function activate(context: ExtensionContext): Promise new ProfilesView(context) ), commands.registerCommand(`code-for-ibmi.connectDirect`, - async (connectionData: ConnectionData, reloadSettings = false): Promise => { + async (connectionData: ConnectionData, reloadSettings = false, savePassword = false): Promise => { const existingConnection = instance.getConnection(); if (existingConnection) { return false; } + if (savePassword && connectionData.password) { + context.secrets.store(`${connectionData.name}_password`, `${connectionData.password}`); + } + return (await new IBMi().connect(connectionData, undefined, reloadSettings)).success; } ),