fix: await token persistence to prevent authentication loop (#524)

Co-authored-by: Cameron <cpfiffer@users.noreply.github.com>
This commit is contained in:
Cameron
2026-01-12 15:04:41 -08:00
committed by GitHub
parent 7140374879
commit d56d8039d0

View File

@@ -100,6 +100,10 @@ export function SetupUI({ onComplete }: SetupUIProps) {
tokenExpiresAt: now + tokens.expires_in * 1000,
});
// Wait for all pending writes (keychain, disk) to complete before continuing
// This prevents a race condition where main() validation runs before tokens are persisted
await settingsManager.flush();
setMode("done");
setTimeout(() => onComplete(), 1000);
} catch (err) {