use clientSessionBackend2 where available
avoids a warning, which says it's faster
This commit is contained in:
parent
56830af8d8
commit
01ce6849de
1 changed files with 11 additions and 3 deletions
|
@ -140,9 +140,17 @@ webAppSessionBackend _ = do
|
||||||
Left e -> error $ "failed to generate random key: " ++ show e
|
Left e -> error $ "failed to generate random key: " ++ show e
|
||||||
Right (s, _) -> case CS.initKey s of
|
Right (s, _) -> case CS.initKey s of
|
||||||
Left e -> error $ "failed to initialize key: " ++ show e
|
Left e -> error $ "failed to initialize key: " ++ show e
|
||||||
Right key -> return $ Just $
|
Right key -> use key
|
||||||
|
where
|
||||||
Yesod.clientSessionBackend key 120
|
timeout = 120 * 60 -- 120 minutes
|
||||||
|
use key =
|
||||||
|
#if MIN_VERSION_yesod(1,1,7)
|
||||||
|
Just . Yesod.clientSessionBackend2 key . fst
|
||||||
|
<$> Yesod.clientSessionDateCacher timeout
|
||||||
|
#else
|
||||||
|
return $ Just $
|
||||||
|
Yesod.clientSessionBackend key timeout
|
||||||
|
#endif
|
||||||
|
|
||||||
{- Generates a random sha512 string, suitable to be used for an
|
{- Generates a random sha512 string, suitable to be used for an
|
||||||
- authentication secret. -}
|
- authentication secret. -}
|
||||||
|
|
Loading…
Add table
Reference in a new issue