You need to use maybeAuth
from Haskell code to get authentication information and then $maybe
inside Hamlet to change behavior based on that result. You cannot do maybeAuth
from within Hamlet, since Hamlet does not allow you to do anything (like searching the database).
source
to share