Artifacts
2 files · 1 pending patch
Artifacts
Files touched in this session. Diff, apply or export.
plugins/auth.tsPending +18 −4
// diff preview
+ app.addHook('preHandler', async (req, reply) => {
- app.hook('onRequest', ...)
auth.spec.ts — proposed
Not yet created · will be generated after apply
● Rec
Auto-apply off
↵ send · ⇧↵ new line
Anthropic
AIHUBMIX
CMD-ROUTER-SE
BAI
OpenAI
⌘K
Lokma can make mistakes. Review patches before applying.
Tiling
Chat #482 — Refactor auth middleware
Aylin
Let\'s refactor the auth middleware. Move JWT verification into a Fastify
preHandler hook.Lokma — Claude 4 Sonnet
Perfect — one hook, one decorator, zero magic. Apply patch
— pane A scroll —
Code — plugins/auth.ts
plugins/auth.ts — diff
// Fastify preHandler
app.addHook('preHandler', async (req, reply) => {
if (!req.routeOptions.config?.auth) return
})