@@ -7,7 +7,7 @@ import type {
77	INodeCredentialTestResult , 
88	INodeProperties , 
99}  from  'n8n-workflow' ; 
10- import  {  deepCopy ,  LoggerProxy ,  NodeHelpers  }  from  'n8n-workflow' ; 
10+ import  {  CREDENTIAL_EMPTY_VALUE ,   deepCopy ,  LoggerProxy ,  NodeHelpers  }  from  'n8n-workflow' ; 
1111import  {  Container  }  from  'typedi' ; 
1212import  type  {  FindManyOptions ,  FindOptionsWhere  }  from  'typeorm' ; 
1313import  {  In  }  from  'typeorm' ; 
@@ -300,16 +300,23 @@ export class CredentialsService {
300300		for  ( const  dataKey  of  Object . keys ( copiedData ) )  { 
301301			// The frontend only cares that this value isn't falsy. 
302302			if  ( dataKey  ===  'oauthTokenData' )  { 
303- 				copiedData [ dataKey ]  =  CREDENTIAL_BLANKING_VALUE ; 
303+ 				if  ( copiedData [ dataKey ] . toString ( ) . length  >  0 )  { 
304+ 					copiedData [ dataKey ]  =  CREDENTIAL_BLANKING_VALUE ; 
305+ 				}  else  { 
306+ 					copiedData [ dataKey ]  =  CREDENTIAL_EMPTY_VALUE ; 
307+ 				} 
304308				continue ; 
305309			} 
306310			const  prop  =  properties . find ( ( v )  =>  v . name  ===  dataKey ) ; 
307311			if  ( ! prop )  { 
308312				continue ; 
309313			} 
310314			if  ( prop . typeOptions ?. password )  { 
311- 				// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access 
312- 				copiedData [ dataKey ]  =  CREDENTIAL_BLANKING_VALUE ; 
315+ 				if  ( copiedData [ dataKey ] . toString ( ) . length  >  0 )  { 
316+ 					copiedData [ dataKey ]  =  CREDENTIAL_BLANKING_VALUE ; 
317+ 				}  else  { 
318+ 					copiedData [ dataKey ]  =  CREDENTIAL_EMPTY_VALUE ; 
319+ 				} 
313320			} 
314321		} 
315322
@@ -321,7 +328,7 @@ export class CredentialsService {
321328		// eslint-disable-next-line @typescript-eslint/no-unsafe-argument 
322329		for  ( const  [ key ,  value ]  of  Object . entries ( unmerged ) )  { 
323330			// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access 
324- 			if  ( value  ===  CREDENTIAL_BLANKING_VALUE )  { 
331+ 			if  ( value  ===  CREDENTIAL_BLANKING_VALUE   ||   value   ===   CREDENTIAL_EMPTY_VALUE )  { 
325332				// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access 
326333				unmerged [ key ]  =  replacement [ key ] ; 
327334			}  else  if  ( 
0 commit comments