You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
828 B
Go
34 lines
828 B
Go
package user
|
|
|
|
import (
|
|
"github.com/0xJacky/Nginx-UI/internal/middleware"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func InitAuthRouter(r *gin.RouterGroup) {
|
|
r.POST("/login", Login)
|
|
r.DELETE("/logout", Logout)
|
|
|
|
r.GET("/casdoor_uri", GetCasdoorUri)
|
|
r.POST("/casdoor_callback", CasdoorCallback)
|
|
}
|
|
|
|
func InitManageUserRouter(r *gin.RouterGroup) {
|
|
r.GET("users", GetUsers)
|
|
r.GET("user/:id", GetUser)
|
|
r.POST("user", AddUser)
|
|
r.POST("user/:id", EditUser)
|
|
r.DELETE("user/:id", DeleteUser)
|
|
}
|
|
|
|
func InitUserRouter(r *gin.RouterGroup) {
|
|
r.GET("/otp_status", OTPStatus)
|
|
r.GET("/otp_secret", GenerateTOTP)
|
|
r.POST("/otp_enroll", EnrollTOTP)
|
|
r.POST("/otp_reset", ResetOTP)
|
|
|
|
r.GET("/otp_secure_session_status",
|
|
middleware.RequireSecureSession(), SecureSessionStatus)
|
|
r.POST("/otp_secure_session", StartSecure2FASession)
|
|
}
|