修复 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

+5 -1
View File
@@ -641,7 +641,7 @@ func TestMultiDB_LatestMigrationsDownUp(t *testing.T) {
t.Fatalf("set goose dialect: %v", err)
}
goose.SetBaseFS(migrationsFS)
for i := 0; i < 8; i++ {
for i := 0; i < 9; i++ {
if err := goose.Down(tg.store.DB, "migrations/"+subdir); err != nil {
t.Fatalf("migration down #%d: %v", i+1, err)
}
@@ -655,6 +655,9 @@ func TestMultiDB_LatestMigrationsDownUp(t *testing.T) {
if columnExistsForDialect(t, tg.store.DB, tg.dialect, "default_reply_records", "status") {
t.Fatal("default_reply_records.status should be removed after down")
}
if columnExistsForDialect(t, tg.store.DB, tg.dialect, "account_tokens", "cookie_fingerprint") {
t.Fatal("account_tokens.cookie_fingerprint should be removed after down")
}
if err := goose.Up(tg.store.DB, "migrations/"+subdir); err != nil {
t.Fatalf("migration up after down: %v", err)
@@ -673,6 +676,7 @@ func TestMultiDB_LatestMigrationsDownUp(t *testing.T) {
{"default_reply_records", "text_sent"},
{"automation_runs", "action_cursor"},
{"automation_runs", "action_started"},
{"account_tokens", "cookie_fingerprint"},
} {
if !columnExistsForDialect(t, tg.store.DB, tg.dialect, c.table, c.col) {
t.Fatalf("column missing after re-up: %s.%s", c.table, c.col)