Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/routers/router.go line 70: apiV1.Use(middleware.Auth())报错 #71

Open
Huzh6 opened this issue Sep 8, 2022 · 2 comments
Open

Comments

@Huzh6
Copy link

Huzh6 commented Sep 8, 2022

middleware.Auth()函数缺少参数,我刚刚clone这个项目,看到修改是两天前,请问下这是的传参应该是什么呀

@qloog
Copy link
Contributor

qloog commented Sep 9, 2022

新增了可以过滤不需要验证的路由路径参数 apiV1.Use(middleware.Auth([]string{})),已修复,可以再拉下试试

可能传参方式不太优雅,后面抽空再完善下。

@qloog
Copy link
Contributor

qloog commented Sep 9, 2022

已优化,Auth() 可以继续保持不许用传递参数。
如果部分路由不需要认证,可以在此过滤,例如: Auth("/login", "/register")
@Huzh6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants