修复 token 与 Cookie 绑定并完善认证恢复

This commit is contained in:
Christ committed 2026-07-15 09:03:20 +08:00
1 parent 16d63dc7c9
commit 3cc1d4094d
30 files changed
+990 -998

No files matched your search

+6 -2
View File
@@ -125,8 +125,8 @@ func TestLatestMigrationsDownUpSQLite(t *testing.T) {
t.Fatalf("goose dialect: %v", err)
}
goose.SetBaseFS(migrationsFS)
// 依次回滚 21 到 14,再整体升级。
for i := 0; i < 8; i++ {
// 依次回滚 22 到 14,再整体升级。
for i := 0; i < 9; i++ {
if err := goose.Down(d, "migrations/sqlite"); err != nil {
t.Fatalf("down migration #%d: %v", i+1, err)
}
@@ -140,6 +140,9 @@ func TestLatestMigrationsDownUpSQLite(t *testing.T) {
if columnExists(t, d, "default_reply_records", "status") {
t.Fatal("default_reply_records.status should be removed after migration 16 down")
}
if columnExists(t, d, "account_tokens", "cookie_fingerprint") {
t.Fatal("account_tokens.cookie_fingerprint should be removed after migration 22 down")
}
if err := goose.Up(d, "migrations/sqlite"); err != nil {
t.Fatalf("up after down: %v", err)
@@ -156,6 +159,7 @@ func TestLatestMigrationsDownUpSQLite(t *testing.T) {
{"risk_control_logs", "processing_status"},
{"default_reply_records", "status"},
{"default_reply_records", "text_sent"},
{"account_tokens", "cookie_fingerprint"},
} {
if !columnExists(t, d, c.table, c.col) {
t.Fatalf("column missing after re-up: %s.%s", c.table, c.col)