douxi0098 2018-12-12 11:45
浏览 269

GoBuffalo和Authboss(身份验证系统)集成

I'm trying to use authboss (https://github.com/volatiletech/authboss) with GoBuffalo (https://github.com/gobuffalo/buffalo).

I'm still learning Go and I think this is a good exercise.

I created a new GoBuffalo app, you can find it here: https://github.com/frederikhors/buffalo-authboss-sample

STEPS TO REPRODUCE

  • git clone https://github.com/frederikhors/buffalo-authboss-sample

  • cd in project root

  • go get -u -v github.com/gobuffalo/buffalo/buffalo

  • go mod tidy

  • buffalo dev

As you can see the new buffalo app is minimal (all the features are commented).

I copied a very small set of instructions from this sample repo: https://github.com/volatiletech/authboss-sample

The app starts but I can't open http://localhost:3000/auth/login (404 page not found).

Using app.Mount("/auth", http.StripPrefix("/auth", ab.Config.Core.Router)) creates routes as you can see in dashboard (http://localhost:3000/) or in the screen below.

Buffalo routes:

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

I can't understand how to tell Buffalo to render authboss views for that routes.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示