diff --git a/src/middleware/auth19.ts b/src/middleware/auth19.ts index f92f678..fec79ad 100644 --- a/src/middleware/auth19.ts +++ b/src/middleware/auth19.ts @@ -38,7 +38,7 @@ const auth19: AppMiddleware = async (c, next) => { /** Throw a 401 if the pubkey isn't set. */ const requirePubkey: AppMiddleware = async (c, next) => { if (!c.get('pubkey')) { - throw new HTTPException(401); + throw new HTTPException(401, { message: 'No pubkey provided' }); } await next(); diff --git a/src/middleware/auth98.ts b/src/middleware/auth98.ts index 8a2272b..20787fe 100644 --- a/src/middleware/auth98.ts +++ b/src/middleware/auth98.ts @@ -81,7 +81,7 @@ function withProof( c.set('proof', proof); await handler(c, proof, next); } else { - throw new HTTPException(401); + throw new HTTPException(401, { message: 'No proof' }); } }; } diff --git a/src/sign.ts b/src/sign.ts index a97478a..14c192f 100644 --- a/src/sign.ts +++ b/src/sign.ts @@ -36,7 +36,7 @@ async function signNostrConnect(event: EventTemplate< const pubkey = c.get('pubkey'); if (!pubkey) { - throw new HTTPException(401); + throw new HTTPException(401, { message: 'Missing pubkey' }); } const messageId = crypto.randomUUID();