Skip to content

Commit

Permalink
websitea/admin: add CSRFTokenInput to home page input
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Jun 19, 2024
1 parent 196cafb commit ab12d6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion website/admin/home.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package admin

import (
"html/template"
"net/http"

radio "github.com/R-a-dio/valkyrie"
"github.com/R-a-dio/valkyrie/util/secret"
"github.com/R-a-dio/valkyrie/website/middleware"
"github.com/gorilla/csrf"
)

type HomeInput struct {
middleware.Input
Daypass string
Daypass string
CSRFTokenInput template.HTML

CanKillStreamer bool

Expand All @@ -23,6 +26,7 @@ func NewHomeInput(r *http.Request, dp secret.Secret) HomeInput {
return HomeInput{
Input: input,
Daypass: dp.Get(nil),
CSRFTokenInput: csrf.TemplateField(r),
CanTemplateReload: input.User.UserPermissions.Has(radio.PermAdmin),
CanKillStreamer: input.User.UserPermissions.Has(radio.PermDJ),
}
Expand Down

0 comments on commit ab12d6a

Please sign in to comment.