fix(schedule): add csrf

This commit is contained in:
Sarah Vaupel 2020-09-17 18:18:33 +02:00
parent 44de231f01
commit 11c5aa0f10
2 changed files with 5 additions and 3 deletions

View File

@ -39,8 +39,8 @@ postScheduleR = do
ScheduleOffsetNone -> ScheduleOffsetNone
offset -> currentScheduleOffset `addOffset` offset
scheduleOptionsForm :: MForm (HandlerFor UniWorX) (FormResult ScheduleOptions, Widget)
scheduleOptionsForm = do
scheduleOptionsForm :: Html -> MForm (HandlerFor UniWorX) (FormResult ScheduleOptions, Widget)
scheduleOptionsForm csrf = do
(viewRess, viewWidgets) <- fmap unzip . for (universeF :: [ScheduleView]) $ \sView ->
mreq (buttonField sView) ("" { fsName = Just $ toPathPiece GetScheduleView
, fsAttrs = if sView == currentScheduleView then [("disabled","")] else mempty
@ -87,7 +87,7 @@ postScheduleR = do
return (scheduleResult, optionsWidget)
((optionsRes, optionsWidget), optionsEnctype) <- runFormGet $ const scheduleOptionsForm
((optionsRes, optionsWidget), optionsEnctype) <- runFormGet scheduleOptionsForm
let
schedule = case optionsRes of

View File

@ -1,5 +1,7 @@
$newline never
#{csrf}
$forall vWgt <- viewWidgets
^{fvWidget vWgt}