mirror of
https://github.com/openai/codex.git
synced 2026-11-20 22:40:37 +00:00
Remove reload auth
This commit is contained in:
@@ -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