File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,10 +142,21 @@ export class CredentialManager {
142142 }
143143
144144 const storageKey = getStorageKey ( `${ config . protocol } ://${ config . serverAddress } :${ config . port } ` , config . user ) ;
145- await this . storeCredentials ( storageKey , config . user , config . password ) ;
146- logger . debug ( `Migrated credentials for ${ config . user } @${ storageKey } to secure storage` ) ;
147- delete config . password ;
148- await launchConfig . update ( "configurations" , configurations , vscode . ConfigurationTarget . WorkspaceFolder ) ;
145+
146+ try {
147+ await this . storeCredentials ( storageKey , config . user , config . password ) ;
148+ const storedPassword = await this . context . secrets . get ( storageKey ) ;
149+ if ( storedPassword !== config . password ) {
150+ throw new Error ( "Failed to verify stored password" ) ;
151+ }
152+
153+ logger . debug ( `Migrated credentials for ${ config . user } @${ storageKey } to secure storage` ) ;
154+ delete config . password ;
155+ await launchConfig . update ( "configurations" , configurations , vscode . ConfigurationTarget . WorkspaceFolder ) ;
156+ } catch ( error ) {
157+ logger . error ( `Failed to migrate credentials for ${ config . user } @${ storageKey } : ${ error } ` ) ;
158+ throw error ;
159+ }
149160 }
150161
151162 async migrateExistingCredentials ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments