fix: fix cookie issue
1 files changed, 3 insertions(+), 2 deletions(-) M middlewares/auth.go
M middlewares/auth.go => middlewares/auth.go +3 -2
@@ 33,8 33,6 @@ func IsAuthenticated(c *gin.Context) { "SELECT EXISTS(SELECT 1 FROM users WHERE id = $1)", user.Id).Scan(&exists) if err != nil || !exists { c.Redirect(http.StatusSeeOther, "/login") c.Abort() session.Clear() if err := session.Save(); err != nil { @@ errStr := "Failed to save session" 42,6 40,9 @@ func IsAuthenticated(c *gin.Context) { util.RenderError(c, "session error", errStr, nil) return } c.Redirect(http.StatusSeeOther, "/login") c.Abort() return } c.Next()