Building a GVA-Based Admin System with Gin, Vue, and JWT
Login Handling with Sestion and JWT
Session-based authentication is required to restrict page access to logged-in users only. The Gin framework provides session middleware via github.com/gin-contrib/sessions.
import "github.com/gin-contrib/sessions"
rootRouter.GET("/login", func(c *gin.Context) {
session := sessions.Def ...
Posted on Tue, 02 Jun 2026 18:38:17 +0000 by jexx
Understanding Gin Middleware Flow: Next(), Abort(), and the Onion Model
Gin Context Handling
// Gin context processing
func (engine *Engine) HandleContext(c *Context) {
oldIndexValue := c.index
c.reset()
engine.handleHTTPRequest(c)
c.index = oldIndexValue
}
// Route matching logic
func (engine *Engine) handleHTTPRequest(c *Context) {
httpMethod := c.Request.Method
rPath := c.Request.URL.Path
unes ...
Posted on Thu, 28 May 2026 16:40:28 +0000 by kriss37