WIP
This commit is contained in:
parent
d2b67d5071
commit
f3f2be99f3
1 changed files with 30 additions and 4 deletions
34
src/state.rs
34
src/state.rs
|
@ -23,10 +23,36 @@ pub struct Creds {
|
||||||
pub password: Secret<String>,
|
pub password: Secret<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(Debug)]
|
||||||
pub enum AuthnError {
|
pub struct AuthnError {}
|
||||||
#[error("{0}")]
|
|
||||||
Eyre(#[from] Error),
|
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]
|
#[async_trait]
|
||||||
|
|
Loading…
Reference in a new issue