YesodAuthEmail could not deduce m ~ HandlerFor site0 [duplicate]

时光怂恿深爱的人放手 提交于 2019-12-01 12:16:20

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!