简体   繁体   English

安装 Obelisk-OAuth

[英]Installing Obelisk-OAuth

I am trying to add Obelisk-OAuth to my project: https://github.com/obsidiansystems/obelisk-oauth我正在尝试将 Obelisk-OAuth 添加到我的项目中: https://github.com/obsidiansystems/obelisk-oauth

At this instruction I am stuck:在这个指令中,我被卡住了:

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

The only thing that I see similar in my Obelisk project is:我在方尖碑项目中看到的唯一相似之处是:

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

From Backend.hs.来自后端.hs。

But this does not seem like the correct location.但这似乎不是正确的位置。

Has anyone encountered this before?有没有人遇到过这个? Where do I insert that pathComponentEncoder $ \case expression?我在哪里插入pathComponentEncoder $ \case表达式?

fullRouteEncoder is defined in common/src/Common/Route.hs . fullRouteEncodercommon/src/Common/Route.hs中定义。

All routes are defined in the "common" package (which is shared between the frontend and the backend).所有路由都在“通用”package 中定义(在前端和后端之间共享)。 This is where you would inject the oauth routes.这是您将注入 oauth 路由的地方。 The file you quoted above is Backend.hs, which uses fullRouteEncoder defined in common.您上面引用的文件是 Backend.hs,它使用了共同定义的fullRouteEncoder

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM