首页 > 解决方案 > 安装 Obelisk-OAuth

问题描述

我正在尝试将 Obelisk-OAuth 添加到我的项目中:https ://github.com/obsidiansystems/obelisk-oauth

在这个指令中,我被卡住了:

Your backend route encoder should handle this case:
  ...
  pathComponentEncoder $ \case
    BackendRoute_OAuth -> PathSegment "oauth" oauthRouteEncoder
  ...

我在 Obelisk 项目中看到的唯一相似之处是:

backend :: Backend BackendRoute FrontendRoute
backend = Backend
  { _backend_run = \serve -> serve $ const $ return ()
  , _backend_routeEncoder = fullRouteEncoder
  }

来自后端.hs。

但这似乎不是正确的位置。

有没有人遇到过这个?我在哪里插入该pathComponentEncoder $ \case表达式?

标签: haskellreflexobelisk

解决方案


fullRouteEncoder中定义common/src/Common/Route.hs

所有路由都在“common”包中定义(在前端和后端之间共享)。这是您将注入 oauth 路由的地方。您在上面引用的文件是 Backend.hs,它使用fullRouteEncodercommon 定义。


推荐阅读