mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-09 19:08:57 +00:00
login page tweaks
This commit is contained in:
@@ -41,12 +41,12 @@ func (m *authMiddleware) handler(c *router.Context) {
|
||||
return
|
||||
} else {
|
||||
// TODO: show error
|
||||
c.Out.Header().Set("Content-Type", "text/html")
|
||||
assets.Render("login.html", c.Out, nil)
|
||||
c.HTML(http.StatusOK, assets.Template("login.html"), map[string]string{
|
||||
"username": username,
|
||||
"error": "Invalid username/password",
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
c.Out.Header().Set("Content-Type", "text/html")
|
||||
assets.Render("login.html", c.Out, nil)
|
||||
c.HTML(http.StatusOK, assets.Template("login.html"), nil)
|
||||
}
|
||||
|
||||
@@ -51,8 +51,7 @@ func (s *Server) handler() http.Handler {
|
||||
}
|
||||
|
||||
func (s *Server) handleIndex(c *router.Context) {
|
||||
c.Out.Header().Set("Content-Type", "text/html")
|
||||
assets.Render("index.html", c.Out, nil)
|
||||
c.HTML(http.StatusOK, assets.Template("index.html"), nil)
|
||||
}
|
||||
|
||||
func (s *Server) handleStatic(c *router.Context) {
|
||||
|
||||
Reference in New Issue
Block a user