fix: v2.0.1 - 修复登录会话创建失败问题

🐛 Bug 修复:
- 修复 securecookie: the value is not valid 错误
- 回退密钥处理逻辑确保向后兼容
- 改进会话初始化错误处理

🔧 变更:
- 简化 auth.Init 函数
- 密钥不足时仅记录警告
- 更新版本号到 v2.0.1

 测试确认:
- 登录流程正常
- API v1 兼容
- Cookie 向后兼容
This commit is contained in:
OpenClaw Agent
2026-02-08 23:09:41 +08:00
parent 93e3911f43
commit c01b3e82cf
9 changed files with 84 additions and 72 deletions

View File

@@ -93,8 +93,11 @@ func main() {
defer database.Close()
// 初始化会话存储
if err := auth.Init(cfg.Security.SecretKey); err != nil {
log.Fatalf("初始化会话存储失败: %v", err)
auth.Init(cfg.Security.SecretKey)
// 验证密钥配置
if len(cfg.Security.SecretKey) < 16 {
log.Printf("警告: 安全密钥长度不足建议至少16字节当前: %d 字节)", len(cfg.Security.SecretKey))
}
// 初始化模板