fix: handle authentication cancellation in auth results

This commit is contained in:
Kevin Yue committed 2026-07-04 18:37:16 +08:00
1 parent d83bb22c58
commit 6e01164a56
5 files changed
+36 -6

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@ use std::{sync::Arc, time::Duration};
use anyhow::bail;
use gpapi::{
auth::SamlAuthData,
auth::{AuthenticationCancelled, SamlAuthData},
gp_params::GpParams,
os_profile::{WebviewUserAgent, WebviewUserAgentTransform},
utils::redact::redact_uri,
@@ -130,7 +130,7 @@ impl<'a> WebviewAuthenticator<'a> {
loop {
match auth_messenger.subscribe().await? {
AuthEvent::Close => bail!("Authentication cancelled"),
AuthEvent::Close => bail!(AuthenticationCancelled),
AuthEvent::RaiseWindow => self.raise_window(&auth_window),
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
AuthEvent::Error(AuthError::TlsError) => bail!(gpapi::error::PortalError::TlsError),