Files
new-api/router/heicode-router.go
T
gongzhiyong 412d7c4610 feat: add HeiCode browser-login bridge endpoints
Add loopback-safe /heicode/oauth authorize/session endpoints for desktop browser login and wire routing/deployment overrides so local source builds include the new auth bridge.
2026-04-29 20:57:27 +08:00

22 lines
605 B
Go

package router
import (
"github.com/QuantumNous/new-api/controller"
"github.com/gin-gonic/gin"
)
// SetHeicodeOAuthRouter wires up HeiCode-specific browser-login bridge endpoints.
// These endpoints are mounted at /heicode/* (no /api prefix) so the redirect_uri
// from HeiCode desktop matches: http(s)://<new-api-host>/heicode/oauth/authorize.
func SetHeicodeOAuthRouter(router *gin.Engine) {
heicode := router.Group("/heicode")
{
oauth := heicode.Group("/oauth")
{
oauth.GET("/authorize", controller.HeicodeOAuthAuthorize)
oauth.GET("/session", controller.HeicodeOAuthSession)
}
}
}