ej_auth/error.rs
1//! Authentication error types.
2
3/// Authentication errors.
4#[derive(Debug, thiserror::Error, Clone)]
5pub enum Error {
6 /// JWT token is invalid or malformed.
7 #[error("Invalid Token")]
8 InvalidToken,
9
10 /// Authentication token was not provided.
11 #[error("Token Missing")]
12 TokenMissing,
13
14 /// JWT token has expired.
15 #[error("Token Expired")]
16 TokenExpired,
17
18 /// JWT token creation or processing failed.
19 #[error(transparent)]
20 TokenCreation(#[from] jsonwebtoken::errors::Error),
21
22 /// Password hashing operation failed.
23 #[error("Error hashing password {0}")]
24 PasswordHash(argon2::password_hash::Error),
25}