@@ -101,9 +101,9 @@ export class PluginProcess {
101101 this . childProcess . kill ( ) ;
102102 }
103103
104- private handleIncomingRequests ( process : ChildProcess ) {
104+ private handleIncomingRequests ( cp : ChildProcess ) {
105105 // Listen for incoming sudo incoming sudo requests
106- process . on ( 'message' , async ( message ) => {
106+ cp . on ( 'message' , async ( message ) => {
107107 if ( ! ipcMessageValidator ( message ) ) {
108108 throw new Error ( `Invalid message from plugin. ${ JSON . stringify ( message , null , 2 ) } ` ) ;
109109 }
@@ -117,7 +117,7 @@ export class PluginProcess {
117117 const { command, options } = data as unknown as SudoRequestData ;
118118 const result = await sudoSpawn ( command , options ) ;
119119
120- process . send ( < IpcMessageV2 > {
120+ cp . send ( < IpcMessageV2 > {
121121 cmd : MessageCmd . SUDO_REQUEST + '_Response' ,
122122 data : result ,
123123 requestId,
@@ -130,7 +130,7 @@ export class PluginProcess {
130130 throw new Error ( `Invalid sudo request from plugin. ${ JSON . stringify ( sudoRequestValidator . errors , null , 2 ) } ` ) ;
131131 }
132132
133- process . send ( < IpcMessageV2 > {
133+ cp . send ( < IpcMessageV2 > {
134134 cmd : MessageCmd . PRESS_KEY_TO_CONTINUE_REQUEST + '_Response' ,
135135 data : { } ,
136136 requestId,
@@ -140,19 +140,14 @@ export class PluginProcess {
140140 if ( message . cmd === MessageCmd . CODIFY_CREDENTIALS_REQUEST ) {
141141 const { requestId } = message ;
142142
143- const loginJson = await fs . readFile ( path . join ( os . homedir ( ) , '.codify' , 'credentials.json' ) , 'utf8' ) ;
144- if ( ! loginJson ) {
145- throw new Error ( 'Unable to get login credentials' )
143+ const testJwt = process . env . VITE_CODIFY_TEST_JWT ;
144+ if ( ! testJwt ) {
145+ throw new Error ( 'Unable to parse login credentials from VITE_CODIFY_TEST_JWT env var. Please set and try again' ) ;
146146 }
147147
148- const login = JSON . parse ( loginJson ) ;
149- if ( ! login ) {
150- throw new Error ( 'Unable to parse login credentials' )
151- }
152-
153- process . send ( < IpcMessageV2 > {
148+ cp . send ( < IpcMessageV2 > {
154149 cmd : MessageCmd . CODIFY_CREDENTIALS_REQUEST + '_Response' ,
155- data : login . accessToken ,
150+ data : testJwt ,
156151 requestId,
157152 } )
158153 }
0 commit comments