func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData {
	td.Flash = app.Session.PopString(r.Context(), "flash")
	td.Warning = app.Session.PopString(r.Context(), "warning")
	td.Error = app.Session.PopString(r.Context(), "error")
	td.CSRFToken = nosurf.Token(r)
	if app.Session.Exists(r.Context(), "user_id") {
		td.IsAuthenticated = 1
	}
	return td
}
// AddDefaultData add default data to templates
AddDefaultData add default data to templates
// AddDefaultData add default data to templates
func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData {
	td.Flash = app.Session.PopString(r.Context(), "flash")
	td.Warning = app.Session.PopString(r.Context(), "warning")
	td.Error = app.Session.PopString(r.Context(), "error")
	td.CSRFToken = nosurf.Token(r)
	if app.Session.Exists(r.Context(), "user_id") {
		td.IsAuthenticated = 1
	}
	return td
}
func AddDefaultData ( td * models . TemplateData , r * http . Request ) * models . TemplateData { td . Flash = app . Session . PopString ( r . Context ( ) , " " ) td . Warning = app . Session . PopString ( r . Context ( ) , " " ) td . Error = app . Session . PopString ( r . Context ( ) , " " ) td . CSRFToken = nosurf . Token ( r ) if app . Session . Exists ( r . Context ( ) , " " ) { td . IsAuthenticated = 1 } return td }
AddDefaultData add default data to templates
AddDefaultData add default data to templates