From fa10a2b08aee309a46e1602730f3e472ec1c81ae Mon Sep 17 00:00:00 2001 From: pilcrowOnPaper Date: Tue, 2 Apr 2024 22:11:25 +0900 Subject: [PATCH] format --- src/posts/middleware-auth.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/posts/middleware-auth.md b/src/posts/middleware-auth.md index a5681a4..7f7d737 100644 --- a/src/posts/middleware-auth.md +++ b/src/posts/middleware-auth.md @@ -1,7 +1,7 @@ --- title: "Please stop using middleware to protect your routes" description: "Stop overthinking and over-abstracting." -date: "2024-3-31" +date: "2024-03-31" --- When talking about auth, there seems be a certain group that's adamant on using middleware to handle authorization. Middleware here refers to functions that run before every request. @@ -84,7 +84,7 @@ If you're too lazy to write some basic if checks, maybe that's a you problem. Bu ```ts app.get( "/", - protectedRoute((req, res) => { + protectedRoute((req, res, user) => { // ... }) );