control: Generalize cookie and csrf handling
This commit is contained in:
parent
eb17dbe33f
commit
34bdb3cf24
15 changed files with 122 additions and 44 deletions
|
|
@ -22,7 +22,13 @@ var (
|
|||
_ component.Routeable = (*UserPanel)(nil)
|
||||
)
|
||||
|
||||
func (panel *UserPanel) Routes() []string { return []string{"/user/"} }
|
||||
func (panel *UserPanel) Routes() component.Routes {
|
||||
return component.Routes{
|
||||
Paths: []string{"/user/"},
|
||||
CSRF: true,
|
||||
Decorator: panel.Dependencies.Auth.Require(nil),
|
||||
}
|
||||
}
|
||||
|
||||
func (panel *UserPanel) HandleRoute(ctx context.Context, route string) (http.Handler, error) {
|
||||
router := httprouter.New()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue