The type of runDB is:
runDB :: YesodDB site a -> HandlerFor site a
in order to call it in AuthHandler
you need to lift it to HandlerFor
.
If I am not mistaken this is what the liftHandler method from MonadHandler
is for.
If you compose your runDB
call with it, it should work:
addUnverified email verkey =
liftHandler . runDB $ insert $ User email Nothing
I found a detailed answer to your question here.