Skip to content

Commit 65abec7

Browse files
committed
fix: add explicit return type and rename unused catch variable for ESLint
1 parent 4f4f74b commit 65abec7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

apps/backend/src/routes/follow.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';
1+
import { getPlatform, getProfileUrl, getWebViewUrl } from '@devcard/shared';
2+
23
import { decrypt } from '../utils/encryption.js';
34
import { getErrorMessage } from '../utils/error.util.js';
4-
import { getPlatform, getProfileUrl, getWebViewUrl } from '@devcard/shared';
55
import { followLogSchema } from '../validations/follow.validation.js';
6+
67
import type { AuthenticatedUser } from '../types/fastify.js';
8+
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';
79

8-
export async function followRoutes(app: FastifyInstance) {
10+
export async function followRoutes(app: FastifyInstance): Promise<void> {
911
app.addHook('preHandler', async (request, reply) => {
1012
const server = request.server;
1113
if (typeof server?.authenticate === 'function') { await server.authenticate(request, reply); return }
1214
if (typeof app.authenticate === 'function') { await app.authenticate(request, reply); return }
13-
try { const payload = await request.jwtVerify<AuthenticatedUser>(); if (payload) request.user = payload; } catch (e) { reply.status(401).send({ error: 'Unauthorized' }) }
15+
try { const payload = await request.jwtVerify<AuthenticatedUser>(); if (payload) {request.user = payload;} } catch (_e) { reply.status(401).send({ error: 'Unauthorized' }) }
1416
});
1517

1618
// ─── Follow via API (Layer 1) ───

0 commit comments

Comments
 (0)