package handlers import ( "net/http" "github.com/gin-gonic/gin" ) type LoginHandler struct{} func NewLoginHandler() *LoginHandler { return &LoginHandler{} } func (lh *LoginHandler) Login(c *gin.Context) { email := c.PostForm("email") password := c.PostForm("password") // Simple check, replace with real auth if email == "test@example.com" && password == "password" { c.Header("Content-Type", "text/html") c.String(http.StatusOK, "
Login successful! Go to Dashboard
") } else { c.Header("Content-Type", "text/html") c.String(http.StatusUnauthorized, "Invalid credentials. Try again.
") } }