mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
- 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
21 lines
508 B
Go
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
|
|
}
|