From 156da2b7943c4715642dc5c8fd7df1f86ca08bb2 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Thu, 7 Jul 2022 14:19:24 +0800 Subject: [PATCH] fix: login don't need auth --- server/controllers/{login.go => auth.go} | 0 server/router.go | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename server/controllers/{login.go => auth.go} (100%) diff --git a/server/controllers/login.go b/server/controllers/auth.go similarity index 100% rename from server/controllers/login.go rename to server/controllers/auth.go diff --git a/server/router.go b/server/router.go index c4e4273ac26..f9c7f790eab 100644 --- a/server/router.go +++ b/server/router.go @@ -18,8 +18,9 @@ func Init(r *gin.Engine) { r.GET("/d/*path", middlewares.Down, controllers.Down) r.GET("/p/*path", middlewares.Down, controllers.Proxy) + r.POST("/api/auth/login", controllers.Login) + api := r.Group("/api", middlewares.Auth) - api.POST("/auth/login", controllers.Login) api.GET("/auth/current", controllers.CurrentUser) admin := api.Group("/admin", middlewares.AuthAdmin)