From 6124b16e89cc33cf9e3b2df29c709b1f1465ac53 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Tue, 3 Oct 2023 13:16:12 +0300 Subject: [PATCH] fix: abort if not logged in... --- middlewares/auth.go | 1 + 1 file changed, 1 insertion(+) diff --git a/middlewares/auth.go b/middlewares/auth.go index b25109d..b7a8d38 100644 --- a/middlewares/auth.go +++ b/middlewares/auth.go @@ -17,6 +17,7 @@ func IsAuthenticated(c *gin.Context) { if sessions.Default(c).Get("profile") == nil { // TODO: This should probably be validated somehow... DB lookup or something. c.Redirect(http.StatusSeeOther, "/login") + c.Abort() } else { c.Next() } -- 2.44.1