Files
NanoKVM-MIRROR/server/router/auth.go
wj-xiao d7ca7c453d update version to 2.1.4
- changing password will modify both the web user and the system root user
- refactor menu bar
- add oled automatic sleep
- support setting GOMEMLIMIT, and automatically enabled when tailscale is logged in
- some other bug fixes and optimizations
2025-01-10 10:31:38 +08:00

21 lines
508 B
Go

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
}