diff --git a/src/Yesod/Auth/OAuth2/Dispatch.hs b/src/Yesod/Auth/OAuth2/Dispatch.hs index 97b2018..6cafb0a 100644 --- a/src/Yesod/Auth/OAuth2/Dispatch.hs +++ b/src/Yesod/Auth/OAuth2/Dispatch.hs @@ -149,10 +149,8 @@ verifySessionCSRF sessionKey = do requireGetParam :: (MonadError DispatchError m, MonadHandler m) => Text -> m Text -requireGetParam key = do - m <- lookupGetParam key - maybe err return m - where err = throwError $ MissingParameter key +requireGetParam key = + maybe (throwError $ MissingParameter key) pure =<< lookupGetParam key tokenSessionKey :: Text -> Text tokenSessionKey name = "_yesod_oauth2_" <> name