feat: return bind credentials and reuse sync-bound agents on register (Z28)
Phone/bind-code/ticket responses include rotated client_secret; SelfRegister reuses active sync_bound hosts instead of spawning pending; archive coop opinion and keep a living summary. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -146,7 +146,12 @@ func (l *AuthLogic) SelfRegisterAgent(req *types.AgentSelfRegisterReq) (*types.A
|
||||
}
|
||||
msg := "已登记为 pending,请管理员在控制台分配角色并启用后再换票"
|
||||
if reused {
|
||||
msg = "已存在 pending 登记,已轮换 client_secret;仍须管理员分配角色并启用"
|
||||
syncBound := strings.TrimSpace(acc.ChannelID) != "" && strings.TrimSpace(acc.OnlineDBID) != ""
|
||||
if acc.Status == agentstore.StatusActive && syncBound {
|
||||
msg = "已存在同步绑定账号,已轮换 client_secret;请直接用返回的 client_id/client_secret 换票,勿再走绑定表单"
|
||||
} else {
|
||||
msg = "已存在 pending 登记,已轮换 client_secret;仍须管理员分配角色并启用"
|
||||
}
|
||||
}
|
||||
return &types.AgentSelfRegisterResp{
|
||||
Account: *acc,
|
||||
|
||||
Reference in New Issue
Block a user