From ce2ec86b5e8b46dfcab3087d65c4d8e5869701d7 Mon Sep 17 00:00:00 2001 From: Jin Hai Date: Fri, 8 May 2026 16:47:25 +0800 Subject: [PATCH] Go: fix CLI logout command (#14672) ### What problem does this PR solve? ``` RAGFlow(user)> logout; SUCCESS ``` ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Signed-off-by: Jin Hai --- internal/cli/common_command.go | 4 ++-- internal/cli/user_parser.go | 25 ++----------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/internal/cli/common_command.go b/internal/cli/common_command.go index b794cc61bb..429e4ee270 100644 --- a/internal/cli/common_command.go +++ b/internal/cli/common_command.go @@ -210,10 +210,10 @@ func (c *RAGFlowClient) Logout() (ResponseIf, error) { if c.ServerType == "admin" { path = "/admin/logout" } else { - path = "/user/logout" + path = "/auth/logout" } - resp, err := c.HTTPClient.Request("GET", path, "web", nil, nil) + resp, err := c.HTTPClient.Request("POST", path, "web", nil, nil) if err != nil { return nil, err } diff --git a/internal/cli/user_parser.go b/internal/cli/user_parser.go index 60d8eb7d91..ac6bbf358e 100644 --- a/internal/cli/user_parser.go +++ b/internal/cli/user_parser.go @@ -113,27 +113,6 @@ func (p *Parser) parseListCommand() (*Command, error) { p.nextToken() // consume LIST switch p.curToken.Type { - case TokenServices: - p.nextToken() - // Semicolon is optional for SHOW TOKEN - if p.curToken.Type == TokenSemicolon { - p.nextToken() - } - return NewCommand("list_services"), nil - case TokenUsers: - p.nextToken() - // Semicolon is optional for SHOW TOKEN - if p.curToken.Type == TokenSemicolon { - p.nextToken() - } - return NewCommand("list_users"), nil - case TokenRoles: - p.nextToken() - // Semicolon is optional for SHOW TOKEN - if p.curToken.Type == TokenSemicolon { - p.nextToken() - } - return NewCommand("list_roles"), nil case TokenVars: p.nextToken() // Semicolon is optional for SHOW TOKEN @@ -335,9 +314,9 @@ func (p *Parser) parseShowCommand() (*Command, error) { p.nextToken() } return NewCommand("show_current_model"), nil - } else { - return nil, fmt.Errorf("expected USER or MODEL after CURRENT") } + + return nil, fmt.Errorf("expected USER or MODEL after CURRENT") case TokenUser: return p.parseShowUser() case TokenRole: