diff --git a/codex-rs/login/src/oauth_callback_server.rs b/codex-rs/login/src/oauth_callback_server.rs index 559330086a..f4f4997417 100644 --- a/codex-rs/login/src/oauth_callback_server.rs +++ b/codex-rs/login/src/oauth_callback_server.rs @@ -75,7 +75,7 @@ impl AuthorizationCodeServer { let _ = server_handle.await; Err(io::Error::new( io::ErrorKind::TimedOut, - "OAuth login timed out waiting for the browser callback.", + "OAuth flow timed out waiting for the browser callback.", )) } } @@ -374,10 +374,10 @@ fn process_authorization_code_request( "/cancel" => HandledRequest::ResponseAndExit { status: StatusCode(200), headers: Vec::new(), - body: b"Login cancelled".to_vec(), + body: b"Authentication cancelled".to_vec(), result: Err(io::Error::new( io::ErrorKind::Interrupted, - "Login cancelled", + "Authentication cancelled", )), }, path if path == callback_path => { @@ -405,7 +405,7 @@ fn process_authorization_code_request( return HandledRequest::ResponseAndExit { status: StatusCode(403), headers: html_headers(), - body: b"

Sign-in failed

Return to your terminal.

".to_vec(), + body: b"

Authentication failed

Return to your terminal.

".to_vec(), result: Err(io::Error::new(io::ErrorKind::PermissionDenied, message)), }; } @@ -414,8 +414,9 @@ fn process_authorization_code_request( Some(code) if !code.is_empty() => HandledRequest::ResponseAndExit { status: StatusCode(200), headers: html_headers(), - body: b"

Sign-in complete

You can return to your terminal.

" - .to_vec(), + body: + b"

Authentication complete

You can return to your terminal.

" + .to_vec(), result: Ok(code.clone()), }, _ => HandledRequest::ResponseAndExit { @@ -425,7 +426,7 @@ fn process_authorization_code_request( .to_vec(), result: Err(io::Error::new( io::ErrorKind::InvalidData, - "Missing authorization code. Sign-in could not be completed.", + "Missing authorization code. Authentication could not be completed.", )), }, } @@ -445,8 +446,8 @@ fn authorization_code_error_message(error_code: &str, error_description: Option< if let Some(description) = error_description && !description.trim().is_empty() { - return format!("Sign-in failed: {description}"); + return format!("Authentication failed: {description}"); } - format!("Sign-in failed: {error_code}") + format!("Authentication failed: {error_code}") } diff --git a/codex-rs/tui/src/chatwidget/dotenv_api_key.rs b/codex-rs/tui/src/chatwidget/dotenv_api_key.rs index 0d9ba67af2..1c25b9f57a 100644 --- a/codex-rs/tui/src/chatwidget/dotenv_api_key.rs +++ b/codex-rs/tui/src/chatwidget/dotenv_api_key.rs @@ -95,7 +95,7 @@ fn write_dotenv_file(path: &Path, contents: &str) -> io::Result<()> { #[cfg(unix)] { - std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o600))?; + file.set_permissions(std::fs::Permissions::from_mode(0o600))?; } Ok(())