Files
codex/codex-rs/login/src/device_code_auth_tests.rs
T
Eric Traut f3bfaca3c1 Clarify device-code phishing warning (#31648)
## Why

The existing device-code warning does not help users distinguish a login
they initiated from a phishing attempt. The warning should tell users to
stop when the code came from a website or another person.

## What changed

- Updated the warning in the direct CLI and TUI device-code login flows
with actionable guidance.
- Added focused coverage for the styled direct CLI prompt.
2026-07-08 15:45:57 -07:00

11 lines
328 B
Rust

use super::*;
#[test]
fn device_code_prompt_renders_phishing_warning() {
let prompt = device_code_prompt("https://example.com/device", "ABCD-EFGH");
assert!(prompt.contains(
"\x1b[90mContinue only if you started this login in Codex. If a website or another person gave you this code, cancel.\x1b[0m"
));
}