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)