mirror of
https://github.com/openai/codex.git
synced 2026-06-03 03:41:58 +00:00
Remove reload auth
This commit is contained in:
@@ -576,15 +576,6 @@ impl InProcessAppServerClient {
|
||||
})?
|
||||
}
|
||||
|
||||
/// Reloads managed auth state from disk for the embedded runtime.
|
||||
///
|
||||
/// This keeps embedders off direct `AuthManager` access while still
|
||||
/// allowing onboarding flows to observe auth changes performed outside the
|
||||
/// app-server request path.
|
||||
pub fn reload_auth_from_storage(&self) -> bool {
|
||||
self.shared_core.auth_manager.reload()
|
||||
}
|
||||
|
||||
/// Returns the next in-process event, or `None` when worker exits.
|
||||
///
|
||||
/// Callers are expected to drain this stream promptly. If they fall behind,
|
||||
|
||||
@@ -17,7 +17,6 @@ pub(crate) enum AuthCommand {
|
||||
StartApiKey { api_key: String },
|
||||
StartChatgpt,
|
||||
CancelChatgpt { login_id: String },
|
||||
ReloadManagedChatgptAuth,
|
||||
DeviceCodeFailed { message: String },
|
||||
}
|
||||
|
||||
|
||||
@@ -63,14 +63,12 @@ pub(super) fn start_headless_chatgpt_login(widget: &mut AuthModeWidget, opts: Se
|
||||
result = complete_device_code_login(opts, device_code) => {
|
||||
match result {
|
||||
Ok(()) => {
|
||||
if set_device_code_state_for_active_attempt(
|
||||
let _ = set_device_code_state_for_active_attempt(
|
||||
&sign_in_state,
|
||||
&request_frame,
|
||||
&cancel,
|
||||
SignInState::ChatGptSuccessMessage,
|
||||
) {
|
||||
let _ = auth_command_tx.send(AuthCommand::ReloadManagedChatgptAuth);
|
||||
}
|
||||
);
|
||||
}
|
||||
Err(err) => {
|
||||
if set_device_code_state_for_active_attempt(
|
||||
|
||||
@@ -576,19 +576,6 @@ async fn handle_auth_command(
|
||||
tracing::warn!("failed to cancel onboarding login: {err}");
|
||||
}
|
||||
}
|
||||
AuthCommand::ReloadManagedChatgptAuth => {
|
||||
app_server.reload_auth_from_storage();
|
||||
match account_api.read_account(app_server).await {
|
||||
Ok(response) => {
|
||||
if let Some(auth_widget) = onboarding_screen.auth_widget_mut() {
|
||||
auth_widget.apply_account(response.account.as_ref());
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
tracing::warn!("failed to refresh managed auth after device code login: {err}")
|
||||
}
|
||||
}
|
||||
}
|
||||
AuthCommand::DeviceCodeFailed { message } => {
|
||||
if let Some(auth_widget) = onboarding_screen.auth_widget_mut() {
|
||||
auth_widget.show_device_code_login_error(message);
|
||||
|
||||
Reference in New Issue
Block a user