frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Show HN: macOS tool to restore window layouts

https://github.com/zembutsu/tsubame
1•zembutsu•2m ago•0 comments

30 Years of <Br> Tags

https://www.artmann.co/articles/30-years-of-br-tags
1•FragrantRiver•9m ago•0 comments

Kyoto

https://github.com/stevepeak/kyoto
2•handfuloflight•10m ago•0 comments

Decision Support System for Wind Farm Maintenance Using Robotic Agents

https://www.mdpi.com/2571-5577/8/6/190
1•PaulHoule•10m ago•0 comments

Show HN: X-AnyLabeling – An open-source multimodal annotation ecosystem for CV

https://github.com/CVHub520/X-AnyLabeling
1•CVHub520•13m ago•0 comments

Penpot Docker Extension

https://www.ajeetraina.com/introducing-the-penpot-docker-extension-one-click-deployment-for-self-...
1•rainasajeet•14m ago•0 comments

Company Thinks It Can Power AI Data Centers with Supersonic Jet Engines

https://www.extremetech.com/science/this-company-thinks-it-can-power-ai-data-centers-with-superso...
1•vanburen•17m ago•0 comments

If AIs can feel pain, what is our responsibility towards them?

https://aeon.co/essays/if-ais-can-feel-pain-what-is-our-responsibility-towards-them
2•rwmj•21m ago•3 comments

Elon Musk's xAI Sues Apple and OpenAI over App Store Drama

https://mashable.com/article/elon-musk-xai-lawsuit-apple-openai
1•paulatreides•24m ago•1 comments

Ask HN: Build it yourself SWE blogs?

1•bawis•24m ago•1 comments

Original Apollo 11 Guidance Computer source code

https://github.com/chrislgarry/Apollo-11
3•Fiveplus•30m ago•0 comments

How Did the CIA Lose Nuclear Device?

https://www.nytimes.com/interactive/2025/12/13/world/asia/cia-nuclear-device-himalayas-nanda-devi...
1•Wonnk13•30m ago•0 comments

Is vibe coding the new gateway to technical debt?

https://www.infoworld.com/article/4098925/is-vibe-coding-the-new-gateway-to-technical-debt.html
1•birdculture•34m ago•1 comments

Why Rust for Embedded Systems? (and Why I'm Teaching Robotics with It)

https://blog.ravven.dev/blog/why-rust-for-embedded-systems/
2•aeyonblack•36m ago•0 comments

EU: Protecting children without the privacy nightmare of Digital IDs

https://democrats.eu/en/protecting-minors-online-without-violating-privacy-is-possible/
2•valkrieco•36m ago•0 comments

Using E2E Tests as Documentation

https://www.vaslabs.io/post/using-e2e-tests-as-documentation
1•lihaoyi•37m ago•0 comments

Apple Welcome Screen: iWeb

https://www.apple.com/welcomescreen/ilife/iweb-3/
1•hackerbeat•38m ago•1 comments

Accessible Perceptual Contrast Algorithm (APCA) in a Nutshell

https://git.apcacontrast.com/documentation/APCA_in_a_Nutshell.html
1•Kerrick•39m ago•0 comments

AI agent finds more security flaws than human hackers at Stanford

https://scienceclock.com/ai-agent-beats-human-hackers-in-stanford-cybersecurity-experiment/
3•ashishgupta2209•40m ago•2 comments

Nano banana prompts, updates everyday

https://github.com/fionalee1412/bestnanobananaprompt-github
4•AI_kid1412•44m ago•0 comments

Skills vs. Dynamic MCP Loadouts

https://lucumr.pocoo.org/2025/12/13/skills-vs-mcp/
2•cube2222•48m ago•0 comments

Top validated AI-SaaS Ideas are available here

1•peterbricks•52m ago•0 comments

UnmaskIP: A Clean, Ad-Free IP and Deep Packet Leak Checker

https://unmaskip.net
1•kfwkwefwef•55m ago•0 comments

PydanticAI-DeepAgents – AI Agent Framework planning, filesystem, and subagents

https://github.com/vstorm-co/pydantic-deepagents
1•kacper-vstorm•57m ago•1 comments

DeepCSIM – Detect duplicate and similar code using AST analysis

https://github.com/whm04/deepcsim
1•whm04•58m ago•1 comments

Chip‐8 Technical Reference

https://github.com/mattmikolay/chip-8/wiki/CHIP%E2%80%908-Technical-Reference
1•AlexeyBrin•58m ago•0 comments

Harmonizer – Accessible Color Palettes Generator

https://github.com/evilmartians/harmonizer
1•Kerrick•59m ago•0 comments

The Invitation-Only Stock Market for the Wealthy

https://www.wsj.com/finance/investing/private-stock-market-growth-bb71bde1
4•SirLJ•59m ago•0 comments

News In Simple turns daily headlines into graded English lessons

https://newsinsimple.com
1•nicoo_nicoo•1h ago•1 comments

Building Products in the Era of AI and LLMs

https://life-of-utkarsh.medium.com/building-products-in-the-era-of-ai-llms-0c298d18a003
1•ukrocks007•1h ago•0 comments
Open in hackernews

Please stop using middleware to protect your routes

https://pilcrowonpaper.com/blog/middleware-auth/
2•markerz•1h ago

Comments

codingdave•1h ago
When building up something small and new, sure, checking security in each route is quick and easy. But a time will come where your security, roles, and whatnot have evolved to the point that new features and roles would mean you need to go update every route. Aside from the tedium to do so, it introduces more changes which means more potential for mistakes. That is when middleware is better.

When you do get to that point, don't hard-code checks on whether the current user has the exact roles for that specific route. Instead, get more creative. Every app will have different needs, but I like to do all the setup for the auth checks when they first login, cache an array of their allowed routes on the server, and then you just check whether the cache has the current route on each request. (Yes, and clear that cache if their access changes mid-session.)

Doing so is not much code, performs well at scale, and you never have to touch the routes themselves when refactoring security, you just need to tweak that setup function.