feat: sign in to Copilot, ChatGPT, and Mistral Vibe

Three provider kinds have a browser sign-in, but the add-provider
dialog only accepted a pasted key. A per-account login record now runs
the adapter's InteractiveLogin on the server, reports the instruction,
URL, and code to the dialog, and stores the credential before the
browser sees completion. The credential never reaches the client.

The dialog gets a sign-in stage for flow kinds, with a link, a
copyable code, and retry after failure. Closing the dialog cancels the
flow. ChatGPT's callback lands on the server's loopback port, and the
instruction names the port to forward.
This commit is contained in:
vhaudiquet committed 2026-11-28 18:06:21 +01:00
1 parent 369075a842
commit f5087220da
12 files changed
+927 -23

No files matched your search

+2
View File
@@ -4,6 +4,7 @@ mod config;
mod crypto;
mod db;
mod error;
mod login;
mod models;
mod presence;
mod preview;
@@ -45,6 +46,7 @@ async fn main() -> anyhow::Result<()> {
rooms: Default::default(),
previews: Default::default(),
presence: Default::default(),
logins: Default::default(),
});
let app = api::router(state).layer(TraceLayer::new_for_http());
let listener = tokio::net::TcpListener::bind(&config.listen).await?;