mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-05-06 22:12:23 +08:00
- Added `InitTokenRouter` to define the `/token/short` endpoint for issuing short tokens. - Created `IssueShortToken` function to handle short token generation and response. - Updated WebSocket middleware to require short token for authentication, preventing CSWSH attacks. - Modified user store and login handling to integrate short token functionality. - Enhanced documentation to reflect changes in WebSocket security requirements.
19 lines
319 B
Go
19 lines
319 B
Go
//go:build !unembed
|
|
|
|
package router
|
|
|
|
import (
|
|
"github.com/0xJacky/Nginx-UI/internal/middleware"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func initEmbedRoute(r *gin.Engine) {
|
|
r.Use(middleware.CacheJs())
|
|
r.Use(middleware.SecureSessionCookie())
|
|
|
|
r.Group("/*")
|
|
{
|
|
r.Use(middleware.IPWhiteList(), middleware.ServeStatic())
|
|
}
|
|
}
|