fix: show oauth url and code properly on device auth popup

- Auth flow now waits for user's Enter before starting
- Start auth only when user presses Enter on DeviceAuth popup
- Proper error handling: missing GOOGLE_CLIENT_ID shows clear message
- Error messages displayed in popup with Retry option
- Popup shows instructions before auth, URL+code during auth
- Handle both verification_url and verification_uri field names from Google
- Check HTTP status code and show error_description on failures
- AuthError propagated to render function for display
- Popup border turns green when URL+code are ready
This commit is contained in:
Ruben Rosario
2026-06-20 19:56:41 +01:00
parent 320a9c2572
commit 985e8c9bc9
5 changed files with 138 additions and 61 deletions
+2 -1
View File
@@ -41,6 +41,7 @@ pub struct AppView<'a> {
pub network_status: &'a NetworkStatus,
pub task_list_scroll: u16,
pub detail_scroll: u16,
pub auth_error: Option<&'a str>,
}
pub fn draw(frame: &mut Frame, view: AppView) {
@@ -93,7 +94,7 @@ pub fn draw(frame: &mut Frame, view: AppView) {
Popup::Input => render_input_popup(frame, area, view.popup_input, view.popup_cursor),
Popup::DatePicker => render_date_picker(frame, area, view.draft_date),
Popup::ConfirmDelete => render_confirm_popup(frame, area),
Popup::DeviceAuth { url, code } => render_device_auth_popup(frame, area, url, code),
Popup::DeviceAuth { url, code } => render_device_auth_popup(frame, area, url, code, view.auth_error),
}
}
}