mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 22:46:14 -05:00
fix: handle authentication cancellation in auth results
This commit is contained in:
5 files changed
+36
-6
No files matched your search
@@ -2,7 +2,7 @@ use anyhow::bail;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specta::Type;
|
||||
|
||||
use crate::auth::{SamlAuthData, SamlAuthResult};
|
||||
use crate::auth::{AuthenticationCancelled, SamlAuthData, SamlAuthResult};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Type, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -250,6 +250,7 @@ impl TryFrom<SamlAuthResult> for Credential {
|
||||
fn try_from(value: SamlAuthResult) -> anyhow::Result<Self> {
|
||||
match value {
|
||||
SamlAuthResult::Success(auth_data) => Ok(Self::from(auth_data)),
|
||||
SamlAuthResult::Cancelled => bail!(AuthenticationCancelled),
|
||||
SamlAuthResult::Failure(err) => bail!(err),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user