移除 backend .env,暂时关闭 JWT,改为一次性登录
This commit is contained in:
@@ -7,13 +7,11 @@ import (
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
|
||||
"trade/web/internal/auth"
|
||||
"trade/web/internal/handlers"
|
||||
mw "trade/web/internal/middleware"
|
||||
"trade/web/internal/store"
|
||||
)
|
||||
|
||||
func New(d *handlers.Deps, mgr *auth.Manager, authStore *store.AuthStore, dist fs.FS) http.Handler {
|
||||
func New(d *handlers.Deps, dist fs.FS) http.Handler {
|
||||
r := chi.NewRouter()
|
||||
r.Use(mw.Recover)
|
||||
r.Use(mw.Logger)
|
||||
@@ -22,7 +20,7 @@ func New(d *handlers.Deps, mgr *auth.Manager, authStore *store.AuthStore, dist f
|
||||
r.Post("/login", d.Login)
|
||||
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(mw.RequireUser(mgr, authStore))
|
||||
r.Use(mw.RequireUser)
|
||||
|
||||
r.Post("/logout", d.Logout)
|
||||
r.Get("/me", d.Me)
|
||||
|
||||
Reference in New Issue
Block a user