fix: added Cursor OAuth provider and fixed authentication flow race conditions

- Added Cursor OAuth provider support to CLI authentication flow.
- Fixed race conditions in OAuth callback handling and session picker cleanup.
- Improved JWT token parsing and error handling across OAuth providers.
- Replaced Bun.sleep() with abortable sleep for proper cancellation support.
- Enhanced process execution with concurrent stream reading and better timeout handling.
- Added cache cleanup mechanism for auth storage with 5-minute intervals.
This commit is contained in:
can1357
2026-01-20 19:50:50 +01:00
parent 94f406d4f0
commit 21af96d890
35 changed files with 468 additions and 287 deletions
@@ -28,8 +28,11 @@ export async function selectSession(sessions: SessionInfo[]): Promise<string | n
}
},
() => {
ui.stop();
process.exit(0);
if (!resolved) {
resolved = true;
ui.stop();
process.exit(0);
}
},
);