Add authentication layer
This commit is contained in:
@ -91,9 +91,22 @@ impl From<actix::MailboxError> for HttpErr {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<actix_identity::error::GetIdentityError> for HttpErr {
|
||||
fn from(value: actix_identity::error::GetIdentityError) -> Self {
|
||||
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<actix_identity::error::LoginError> for HttpErr {
|
||||
fn from(value: actix_identity::error::LoginError) -> Self {
|
||||
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<HttpResponse> for HttpErr {
|
||||
fn from(value: HttpResponse) -> Self {
|
||||
HttpErr::HTTPResponse(value)
|
||||
}
|
||||
}
|
||||
|
||||
pub type HttpResult = Result<HttpResponse, HttpErr>;
|
||||
|
Reference in New Issue
Block a user