fix: guide users to enable device code login for ChatGPT OAuth#214
fix: guide users to enable device code login for ChatGPT OAuth#214mwmdev wants to merge 1 commit intospacedriveapp:mainfrom
Conversation
…driveapp#211) OpenAI requires device code login to be enabled in ChatGPT security settings before the OAuth flow can succeed. Handle the 404 response with a clear error message and add a prerequisite note in the UI.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
WalkthroughThe PR adds instructional guidance for users encountering ChatGPT OAuth authentication failures due to disabled device code login. Changes include a UI dialog text update and backend 404 error handling with helpful messaging directing users to enable the feature in ChatGPT security settings. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| {!message && ( | ||
| <DialogDescription> | ||
| Copy the device code below, then sign in to your OpenAI account to authorize access. | ||
| You must first <a href="https://chatgpt.com/security-settings" target="_blank" rel="noopener noreferrer" className="underline text-accent hover:text-accent/80">enable device code login</a> in your ChatGPT security settings. |
There was a problem hiding this comment.
Might be worth inserting a line break so the prerequisite note stands out a bit more in the dialog.
| You must first <a href="https://chatgpt.com/security-settings" target="_blank" rel="noopener noreferrer" className="underline text-accent hover:text-accent/80">enable device code login</a> in your ChatGPT security settings. | |
| <br /> | |
| You must first <a href="https://chatgpt.com/security-settings" target="_blank" rel="noopener noreferrer" className="underline text-accent hover:text-accent/80">enable device code login</a> in your ChatGPT security settings. |
| .await | ||
| .context("failed to read OpenAI device-code usercode response")?; | ||
|
|
||
| if status == reqwest::StatusCode::NOT_FOUND { |
There was a problem hiding this comment.
Small thought: if you ever touch this area again, it might be worth checking the 404 case before calling .text().await so you can skip the body read and still surface the friendly guidance even if body read fails.

Summary
Fixes #211. OpenAI's device code OAuth flow requires users to explicitly enable device code login in their ChatGPT security settings before it can be used. Without this, the auth flow fails with an
unknown_erroratauth.openai.com/error./deviceauth/usercodeendpoint with a specific error message directing users to enable device code login (matches how the official Codex CLI handles this case)Test plan
Note
This PR adds a prerequisite note to the ChatGPT OAuth dialog and improves error handling when device code login is not enabled. The backend now returns a specific 404-based error message instead of a generic failure, and the frontend displays a link to the ChatGPT security settings where users can enable device code login.
Written by Tembo for commit f9ab88a.