mirror of
https://github.com/cuigh/swirl
synced 2024-12-28 14:51:57 +00:00
Add name to login & logout handler
This commit is contained in:
parent
42befba54e
commit
b2de124183
4
main.go
4
main.go
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user