initial commit
- login works - basic documentation
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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}'")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user