chore(oauth2): add debug logs to loginHandler
This commit is contained in:
parent
037f464418
commit
cb7a00fbe0
@ -140,12 +140,17 @@ instance YesodAuth UniWorX where
|
|||||||
plugins <- getsYesod authPlugins
|
plugins <- getsYesod authPlugins
|
||||||
AppSettings{..} <- getsYesod appSettings'
|
AppSettings{..} <- getsYesod appSettings'
|
||||||
|
|
||||||
when appSingleSignOn $ do
|
when appSingleSignOn $
|
||||||
let plugin = P.head $ P.filter ((`elem` [apAzureMock, apAzure]) . apName) plugins
|
let azurePlugins = P.filter ((`elem` [apAzureMock, apAzure]) . apName) plugins
|
||||||
pieces = case oauth2Url (apName plugin) of
|
in if
|
||||||
PluginR _ p -> p
|
| (plugin:_) <- azurePlugins
|
||||||
_ -> error "Unexpected OAuth2 AuthRoute"
|
, PluginR _ p <- oauth2Url (apName plugin) -> do
|
||||||
void $ apDispatch plugin "GET" pieces
|
$logInfoS "SSO" "Azure plugin with plugin url as expected. Calling apDispatch..."
|
||||||
|
void $ apDispatch plugin "GET" pieces
|
||||||
|
| not (null azurePlugins) -> do
|
||||||
|
$logErrorS "SSO" "Azure plugin initialized, but unexpected oauth2Url. Cannot apDispatch."
|
||||||
|
| otherwise -> do
|
||||||
|
$logErrorS "SSO" "No Azure plugin initialized despite SSO being enabled!"
|
||||||
|
|
||||||
toParent <- getRouteToParent
|
toParent <- getRouteToParent
|
||||||
liftHandler . defaultLayout $ do
|
liftHandler . defaultLayout $ do
|
||||||
|
|||||||
Reference in New Issue
Block a user