Skip to content

Commit 9f10f0f

Browse files
committed
fix(migrate-auth-secret): exit cleanly when there are no 2FA records
The empty-records branch of `main()` returned without calling `process.exit(0)`, leaving the Drizzle Postgres connection pool holding the event loop open. The `migrate-auth-secret` process then hangs indefinitely after printing "No 2FA records found, nothing to migrate." causing the upstream `0.29.3.sh` security migration script (which calls this via `docker exec`) to never reach its final `docker service update` step that mounts the new Docker Secret. Operators end up with the new secret created but the dokploy service still configured with the hardcoded `BETTER_AUTH_SECRET`, while believing the migration completed. Match the success branch a few lines below which already does `process.exit(0)`, and the pattern used in sibling scripts `reset-password.ts` and `reset-2fa.ts`. Closes #4392
1 parent b109e0e commit 9f10f0f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/dokploy/scripts/migrate-auth-secret.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function main() {
4646

4747
if (records.length === 0) {
4848
console.log("✅ No 2FA records found, nothing to migrate.");
49-
return;
49+
process.exit(0);
5050
}
5151

5252
console.log(`📦 Found ${records.length} 2FA record(s) to migrate.`);

0 commit comments

Comments
 (0)