Finishing up our response to user, and adding alerts
This commit is contained in:
		@ -21,6 +21,9 @@ func NewTemplates(a *config.AppConfig) {
 | 
			
		||||
 | 
			
		||||
// AddDefaultData adds default template data
 | 
			
		||||
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)
 | 
			
		||||
	return td
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user