Files
keycloak-pam/src/keycloak/api.rs
T
javalsai d2a2baebc8 initial commit
- login works
- basic documentation
2026-05-09 18:06:35 +02:00

22 lines
573 B
Rust

use std::fmt::Display;
use serde::Deserialize;
#[derive(Debug, Deserialize, thiserror::Error)]
pub struct AuthError {
error: String,
error_description: Option<String>,
}
impl Display for AuthError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let error = &self.error;
if let Some(ref error_description) = self.error_description {
writeln!(f, "authentication type '{error}' with message '{error_description:?}'")
} else {
writeln!(f, "authentication type '{error}'")
}
}
}