mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 13:33:48 +08:00
@@ -1347,7 +1347,7 @@ func (h *DocumentHandler) Ingest(c *gin.Context) {
|
||||
|
||||
userID := strings.TrimSpace(user.ID)
|
||||
if userID == "" {
|
||||
common.ResponseWithCodeData(c, common.CodeAuthenticationError, nil, "No Authentication")
|
||||
common.ResponseWithCodeData(c, common.CodeAuthenticationError, nil, "no authentication")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ func (h *UserHandler) ChangePassword(c *gin.Context) {
|
||||
// @Tags users
|
||||
// @Success 200 {object} map[string]interface{}
|
||||
// @Router /v1/user/login/channels [get]
|
||||
func (h *UserHandler) GetLoginChannels(c *gin.Context) {
|
||||
func (h *UserHandler) GetLoginChannelsDeprecated(c *gin.Context) {
|
||||
channels, code, err := h.userService.GetLoginChannels()
|
||||
if err != nil {
|
||||
common.ResponseWithCodeData(c, code, []interface{}{}, "Load channels failure, error: "+err.Error())
|
||||
|
||||
@@ -52,7 +52,7 @@ const oauthAuthCookie = "ragflow_auth"
|
||||
// @Tags users
|
||||
// @Param channel path string true "channel name"
|
||||
// @Router /api/v1/auth/login/{channel} [get]
|
||||
func (h *UserHandler) OAuthLogin(c *gin.Context) {
|
||||
func (h *UserHandler) OAuthLoginDeprecated(c *gin.Context) {
|
||||
channel := c.Param("channel")
|
||||
if channel == "" {
|
||||
common.ResponseWithHttpCodeData(c, http.StatusBadRequest, common.CodeArgumentError, nil, "channel is required")
|
||||
@@ -89,7 +89,7 @@ func (h *UserHandler) OAuthLogin(c *gin.Context) {
|
||||
// @Param code query string true "authorization code"
|
||||
// @Param state query string true "state token"
|
||||
// @Router /api/v1/auth/oauth/{channel}/callback [get]
|
||||
func (h *UserHandler) OAuthChannelCallback(c *gin.Context) {
|
||||
func (h *UserHandler) OAuthChannelCallbackDeprecated(c *gin.Context) {
|
||||
channel := c.Param("channel")
|
||||
// An empty channel segment (/auth/oauth//callback) is a malformed path,
|
||||
// not a real channel. Python's router never matches it and returns 404;
|
||||
|
||||
@@ -65,3 +65,15 @@ func (h *UserHandler) IsAdmin(c *gin.Context) {
|
||||
func (h *UserHandler) GetMeta(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "GetMeta not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) OAuthLogin(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "OAuthLogin not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) OAuthChannelCallback(c *gin.Context) {
|
||||
common.ErrorWithCode(c, common.CodeNotImplemented, "OAuthChannelCallback not implemented")
|
||||
}
|
||||
|
||||
func (h *UserHandler) GetLoginChannels(c *gin.Context) {
|
||||
common.SuccessWithData(c, []interface{}{}, "success")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user