Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Once you can authenticate your users, you can use their credentials to
authorize requests. Authorization in Yesod is simple and
declarative: most of the time, you just need to add the authRoute and isAuthorized methods to
your Yesod typeclass instance. Let’s see an example.
{-# LANGUAGE OverloadedStrings, TemplateHaskell, TypeFamilies,MultiParamTypeClasses, QuasiQuotes #-}importYesodimportYesod.AuthimportYesod.Auth.Dummy-- just for testing, don't use in real life!!!importData.Text(Text)importNetwork.HTTP.Conduit(Manager,newManager,def)dataMyAuthSite=MyAuthSite{httpManager::Manager}mkYesod"MyAuthSite"[parseRoutes|/RootRGETPOST