func PopulateWithGlobalData(d *gin.H, c *gin.Context) { u, loggedIn := user.Current(c) (*d)["LoggedIn"] = loggedIn if loggedIn { (*d)["CurrentUser"] = u } }
// GET /login func SessionNew(c *gin.Context) { cu, loggedIn := user.Current(c) if loggedIn { c.String(http.StatusOK, "Current user: %v", cu.Name) } else { ctl.Render(c, "users-session-new.tmpl", nil) } }