Skip to content

Commit

Permalink
fix undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
mariacarmina committed Mar 12, 2024
1 parent 21334e5 commit 40790a6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/core/adminOperations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ export class StopNodeHandler extends Handler {
'signature'
])
if (!commandValidation.valid) {
CORE_LOGGER.logMessage(
`Command validation failed: ${JSON.stringify(commandValidation)}`
)
return commandValidation
const errorMsg = `Command validation failed: ${JSON.stringify(commandValidation)}`
CORE_LOGGER.logMessage(errorMsg)
return buildInvalidRequestMessage(errorMsg)
}
if (
!validateSignature(command.expiryTimestamp, command.signature, this.getOceanNode())
) {
return buildInvalidRequestMessage('Expired authentication or invalid signature')
const errorMsg = 'Expired authentication or invalid signature'
CORE_LOGGER.logMessage(errorMsg)
return buildInvalidRequestMessage(errorMsg)
}
return commandValidation
}

handle(task: StopNodeCommand): Promise<P2PCommandResponse> {
Expand Down

0 comments on commit 40790a6

Please sign in to comment.