unauthorizedI
This commit is contained in:
parent
6e68102a6f
commit
251f83f673
@ -15,6 +15,7 @@ module Yesod.Core
|
|||||||
, defaultErrorHandler
|
, defaultErrorHandler
|
||||||
-- * Data types
|
-- * Data types
|
||||||
, AuthResult (..)
|
, AuthResult (..)
|
||||||
|
, unauthorizedI
|
||||||
-- * Logging
|
-- * Logging
|
||||||
, LogLevel (..)
|
, LogLevel (..)
|
||||||
, formatLogMessage
|
, formatLogMessage
|
||||||
@ -76,3 +77,9 @@ logError = logTH LevelError
|
|||||||
-- > $(logOther "My new level") "This is a log message"
|
-- > $(logOther "My new level") "This is a log message"
|
||||||
logOther :: Text -> Q Exp
|
logOther :: Text -> Q Exp
|
||||||
logOther = logTH . LevelOther
|
logOther = logTH . LevelOther
|
||||||
|
|
||||||
|
-- | Return an 'Unauthorized' value, with the given i18n message.
|
||||||
|
unauthorizedI :: RenderMessage master msg => msg -> GHandler sub master AuthResult
|
||||||
|
unauthorizedI msg =do
|
||||||
|
mr <- getMessageRender
|
||||||
|
return $ Unauthorized $ mr msg
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user