mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Give requireSigner middleware the right type
This commit is contained in:
parent
9ced9fb31d
commit
c83a2dba7e
1 changed files with 3 additions and 3 deletions
|
|
@ -1,9 +1,9 @@
|
||||||
|
import { MiddlewareHandler } from '@hono/hono';
|
||||||
import { HTTPException } from '@hono/hono/http-exception';
|
import { HTTPException } from '@hono/hono/http-exception';
|
||||||
|
import { NostrSigner } from '@nostrify/nostrify';
|
||||||
import { AppMiddleware } from '@/app.ts';
|
|
||||||
|
|
||||||
/** Throw a 401 if a signer isn't set. */
|
/** Throw a 401 if a signer isn't set. */
|
||||||
export const requireSigner: AppMiddleware = async (c, next) => {
|
export const requireSigner: MiddlewareHandler<{ Variables: { signer: NostrSigner } }> = async (c, next) => {
|
||||||
if (!c.get('signer')) {
|
if (!c.get('signer')) {
|
||||||
throw new HTTPException(401, { message: 'No pubkey provided' });
|
throw new HTTPException(401, { message: 'No pubkey provided' });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue