首页 > 解决方案 > GoBuffalo 和 Authboss(身份验证系统)集成

问题描述

我正在尝试将authbosshttps://github.com/volatiletech/authboss)与GoBuffalohttps://github.com/gobuffalo/buffalo)一起使用。

我还在学习围棋,我认为这是一个很好的练习。

我创建了一个新的 GoBuffalo 应用程序,你可以在这里找到它:https ://github.com/frederikhors/buffalo-authboss-sample

重现步骤

如您所见,新的 buffalo 应用程序很小(所有功能都已注释)。

我从这个示例存储库中复制了一组非常小的说明:https ://github.com/volatiletech/authboss-sample

该应用程序启动,但我无法打开http://localhost:3000/auth/login(未找到 404 页面)。

使用app.Mount("/auth", http.StripPrefix("/auth", ab.Config.Core.Router))创建路由,您可以在仪表板 ( http://localhost:3000/ ) 或下面的屏幕中看到。

布法罗路线

GET     /auth/{path:.+}/    authPath    github.com/gobuffalo/buffalo.WrapHandler.func1
PUT     /auth/{path:.+}/    authPath    github.com/gobuffalo/buffalo.WrapHandler.func1
PATCH   /auth/{path:.+}/    authPath    github.com/gobuffalo/buffalo.WrapHandler.func1
HEAD    /auth/{path:.+}/    authPath    github.com/gobuffalo/buffalo.WrapHandler.func1
OPTIONS /auth/{path:.+}/    authPath    github.com/gobuffalo/buffalo.WrapHandler.func1
DELETE  /auth/{path:.+}/    authPath    github.com/gobuffalo/buffalo.WrapHandler.func1
POST    /auth/{path:.+}/    authPath    github.com/gobuffalo/buffalo.WrapHandler.func1

我不明白如何告诉 Buffalo 为这些路线呈现 authboss 视图。

标签: authenticationgobuffalo

解决方案


推荐阅读