Exemplo n.º 1
0
func Hello(c *gin.Context) {

	session := sessions.Get(c)
	if session.IsLoggedIn() {
		c.Redirect(http.StatusMovedPermanently, "/dashboard")
		return
	}

	content := utils.Render("templates/index.tmpl", gin.H{"handle": session.Handle, "loggedIn": false})
	c.HTML(http.StatusOK, "master.tmpl", gin.H{"content": template.HTML(content)})
}
Exemplo n.º 2
0
func Dashboard(c *gin.Context) {
	session := sessions.Get(c)
	content := utils.Render("templates/dashboard.tmpl", gin.H{"handle": session.Handle, "client_id": config.ClientId()})
	c.HTML(http.StatusOK, "master.tmpl", gin.H{"content": template.HTML(content)})
}