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.
22 lines
605 B
Go
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)
|
|
}
|
|
}
|
|
}
|