Skip to content

Commit

Permalink
improve signature error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
0age committed Dec 12, 2024
1 parent 719df38 commit 17ebcf7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ export async function validateAndCreateSession(
throw new Error('Invalid signature');
}
} catch (error) {
// Log detailed error information
server.log.error({
msg: 'Signature verification failed',
signature,
address: payload.address,
error: error instanceof Error ? error.message : String(error),
// Include additional context that might help debug
signatureLength: signature.length,
messageLength: message.length,
errorType: error?.constructor?.name,
});

throw new Error(
`Invalid signature: ${error instanceof Error ? error.message : String(error)}`
);
Expand Down

0 comments on commit 17ebcf7

Please sign in to comment.