Refactor: Rename NanoKVM to BatchuKVM and update server URL
This commit is contained in:
21
server/router/auth.go
Normal file
21
server/router/auth.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"NanoKVM-Server/middleware"
|
||||
"NanoKVM-Server/service/auth"
|
||||
)
|
||||
|
||||
func authRouter(r *gin.Engine) {
|
||||
service := auth.NewService()
|
||||
|
||||
r.POST("/api/auth/login", service.Login) // login
|
||||
|
||||
api := r.Group("/api").Use(middleware.CheckToken())
|
||||
|
||||
api.GET("/auth/password", service.IsPasswordUpdated) // is password updated
|
||||
api.GET("/auth/account", service.GetAccount) // get account
|
||||
api.POST("/auth/password", service.ChangePassword) // change password
|
||||
api.POST("/auth/logout", service.Logout) // logout
|
||||
}
|
||||
Reference in New Issue
Block a user