Open h1deOnBush opened 4 years ago
You need to update the render()
function in main.go in order to pass the variable to the templates.
func render(c *gin.Context, data gin.H, templateName string) {
loggedInInterface, _ := c.Get("is_logged_in")
data["is_logged_in"] = loggedInInterface.(bool)
switch c.Request.Header.Get("Accept") {
case "application/json":
c.JSON(http.StatusOK, data["payload"])
case "application/xml":
c.XML(http.StatusOK, data["payload"])
default:
c.HTML(http.StatusOK, templateName, data)
}
}
After I log in, the options in the menu bar are still register and login