add frontend auth middleware, embed user data in frontend html
This commit is contained in:
		
							parent
							
								
									d8cb8c8fa8
								
							
						
					
					
						commit
						0fa769a248
					
				
					 12 changed files with 265 additions and 42 deletions
				
			
		|  | @ -7,6 +7,13 @@ import ( | |||
| 	"github.com/flosch/pongo2/v6" | ||||
| ) | ||||
| 
 | ||||
| func (app *App) ErrorTemplate(w http.ResponseWriter, r *http.Request, header, desc string) error { | ||||
| 	return app.Template(w, r, "error.tpl", pongo2.Context{ | ||||
| 		"header":      header, | ||||
| 		"description": desc, | ||||
| 	}) | ||||
| } | ||||
| 
 | ||||
| func (app *App) Template(w http.ResponseWriter, r *http.Request, tmplName string, ctx pongo2.Context) error { | ||||
| 	tmpl, err := app.tmpl.FromCache(tmplName) | ||||
| 	if err != nil { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue