Basic auth in HTTP API
This commit is contained in:
parent
09c9659b88
commit
3e8a39314b
4 changed files with 77 additions and 5 deletions
|
|
@ -55,6 +55,10 @@ impl ApiError {
|
|||
}
|
||||
}
|
||||
|
||||
pub const fn unathorized() -> Self {
|
||||
Self::new_from_text(StatusCode::UNAUTHORIZED, "unauthorized")
|
||||
}
|
||||
|
||||
pub fn status(&self) -> StatusCode {
|
||||
self.status.unwrap_or(StatusCode::INTERNAL_SERVER_ERROR)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue