aboutsummaryrefslogtreecommitdiff
path: root/lib/Server
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Server')
-rw-r--r--lib/Server/Frontend/Routes.hs17
-rw-r--r--lib/Server/Frontend/Ticker.hs2
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/Server/Frontend/Routes.hs b/lib/Server/Frontend/Routes.hs
index 18cf0a1..9245e6a 100644
--- a/lib/Server/Frontend/Routes.hs
+++ b/lib/Server/Frontend/Routes.hs
@@ -69,11 +69,12 @@ instance Yesod Frontend where
isAuthorized OnboardTrackerR _ = pure Authorized
isAuthorized (AuthR _) _ = pure Authorized
isAuthorized _ _ = do
- UffdConfig{..} <- getYesod <&> serverConfigLogin . getSettings
- if uffdConfigEnable then maybeAuthId >>= \case
- Just _ -> pure Authorized
- Nothing -> pure AuthenticationRequired
- else pure Authorized
+ maybeUffd <- getYesod <&> serverConfigLogin . getSettings
+ case maybeUffd of
+ Nothing -> pure Authorized
+ Just UffdConfig{..} -> maybeAuthId >>= \case
+ Just _ -> pure Authorized
+ Nothing -> pure AuthenticationRequired
defaultLayout w = do
@@ -118,9 +119,9 @@ instance YesodAuth Frontend where
type AuthId Frontend = UffdUser
authPlugins cr = case config of
- UffdConfig {..} -> if uffdConfigEnable
- then [ uffdClient uffdConfigUrl uffdConfigClientName uffdConfigClientSecret ]
- else []
+ Just UffdConfig {..} ->
+ [ uffdClient uffdConfigUrl uffdConfigClientName uffdConfigClientSecret ]
+ Nothing -> []
where config = serverConfigLogin (getSettings cr)
maybeAuthId = do
diff --git a/lib/Server/Frontend/Ticker.hs b/lib/Server/Frontend/Ticker.hs
index 8861daa..861197a 100644
--- a/lib/Server/Frontend/Ticker.hs
+++ b/lib/Server/Frontend/Ticker.hs
@@ -30,7 +30,7 @@ tickerWidget = do
generateFormPost (tickerAnnounceForm (current <&> entityVal))
defaultLayout [whamlet|
- <h2>_{MsgTicker}
+ <h2>_{Msgincident}
<form method=post action=@{TickerAnnounceR} enctype=#{enctype}>
^{widget}
<button>_{MsgSubmit}