mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
* Add ability to properly configure logrus (e.x. specify output file) * Make the code slightly more ideomatic (sort imports, etc) * Replace some of the shell calls with equivalent native code * Fix update process * Improve error handling (handle 2 previously unhandled errors) * Add locking for HID operations and make a HID-operations struct a singleton
19 lines
360 B
Go
19 lines
360 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.POST("/auth/password", service.ChangePassword) // change password
|
|
}
|