WIP
This commit is contained in:
parent
d2b67d5071
commit
f3f2be99f3
34
src/state.rs
34
src/state.rs
|
@ -23,10 +23,36 @@ pub struct Creds {
|
|||
pub password: Secret<String>,
|
||||
}
|
||||
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum AuthnError {
|
||||
#[error("{0}")]
|
||||
Eyre(#[from] Error),
|
||||
#[derive(Debug)]
|
||||
pub struct AuthnError {}
|
||||
|
||||
impl std::fmt::Display for AuthnError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str("authentication error");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Error> for AuthnError {
|
||||
fn from(_value: Error) -> Self {
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for AuthnError {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
None
|
||||
}
|
||||
|
||||
fn description(&self) -> &str {
|
||||
"description() is deprecated; use Display"
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&dyn std::error::Error> {
|
||||
self.source()
|
||||
}
|
||||
|
||||
fn provide<'a>(&'a self, request: &mut std::error::Request<'a>) {}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
|
Loading…
Reference in a new issue