diff options
-rw-r--r-- | src/api/error.rs | 5 | ||||
-rw-r--r-- | src/auth/error.rs | 3 |
2 files changed, 1 insertions, 7 deletions
diff --git a/src/api/error.rs b/src/api/error.rs index 9048c20..3733d50 100644 --- a/src/api/error.rs +++ b/src/api/error.rs @@ -27,9 +27,6 @@ pub enum Error { #[error("Failed to reach authentication server: {0}")] AuthRequest(#[from] axum::http::Error), - #[error("Not authorization values found")] - Unauthorized, - #[error("Authentication error: {0}")] Auth(#[from] crate::auth::error::Error), } @@ -52,7 +49,7 @@ impl axum::response::IntoResponse for Error { let status = match self { Self::RouteNotFound(_) | Self::UserNotFound => StatusCode::NOT_FOUND, Self::EmailExists => StatusCode::CONFLICT, - Self::InvalidToken | Self::Unauthorized => StatusCode::UNAUTHORIZED, + Self::InvalidToken => StatusCode::UNAUTHORIZED, Self::HeaderNotFound(ref h) if h == AUTHORIZATION => StatusCode::UNAUTHORIZED, Self::HeaderNotFound(_) => StatusCode::BAD_REQUEST, Self::EmailInvalid(_) | Self::Header(_) => StatusCode::UNPROCESSABLE_ENTITY, diff --git a/src/auth/error.rs b/src/auth/error.rs index 8b1bb4c..17cf6d1 100644 --- a/src/auth/error.rs +++ b/src/auth/error.rs @@ -33,9 +33,6 @@ pub enum Error { #[error("Authorization token not found")] JwtNotFound, - #[error("Token found was invalid type")] - InvalidTokenType, - #[error("The user belonging to this token no longer exists")] UserNotFound, } |