Add name to login & logout handler

This commit is contained in:
cuigh 2017-12-20 16:31:05 +08:00
parent 42befba54e
commit b2de124183

View File

@ -84,8 +84,8 @@ func server() *web.Server {
g := ws.Group("", form, filter.NewAuthorizer(biz.User.Authorize))
// register auth handlers
g.Post("/login", form.LoginJSON(biz.User.Login)).SetAuthorize(web.AuthAnonymous)
g.Get("/logout", form.Logout).SetAuthorize(web.AuthAuthenticated)
g.Post("/login", form.LoginJSON(biz.User.Login), web.WithName("login"), web.WithAuthorize(web.AuthAnonymous))
g.Get("/logout", form.Logout, web.WithName("logout"), web.WithAuthorize(web.AuthAuthenticated))
// register controllers
g.Handle("", controller.Home())