mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
feat: support downloading image from online URL feat: add keyboard shortcut Ctrl+Alt+Del fix: fix the CSRF issue perf: add an option to configure custom ICE servers perf: removed unnecessary modifications to DNS configuration perf: add an SSH enable/disable toggle in the web UI perf: add a Tailscale enable/disable toggle in the web UI perf: download Tailscale installation package from the official source perf: automatic enable/disable GOMEMLIMIT on tailscale start/stop perf: add JWT configuration perf: implement secure password storage using bcrypt hashing perf: implement integrity checks for online updates refactor: refactor HDMI module and remove the dependency libmaixcam_lib.so refactor: web terminal use pty instead of SSH refactor: move Tailscale APIs from the network module to the extensions module
22 lines
572 B
Go
22 lines
572 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
|
|
api.POST("/auth/logout", service.Logout) // logout
|
|
}
|