feat(auth): implement JWT authentication and user registration
- Added JWT authentication with token generation and validation. - Introduced user registration functionality with email and password. - Integrated Argon2 for password hashing. - Created SQLite user repository for user data persistence. - Updated application context to include user repository and configuration settings. - Added environment variable support for JWT secret and registration allowance. - Enhanced error handling for unauthorized access and validation errors. - Updated presentation layer to handle login and registration requests.
This commit is contained in:
@@ -18,6 +18,7 @@ impl IntoResponse for ApiError {
|
||||
DomainError::InvalidRating { .. } => (StatusCode::BAD_REQUEST, self.0.to_string()),
|
||||
DomainError::ValidationError(msg) => (StatusCode::BAD_REQUEST, msg),
|
||||
DomainError::NotFound(msg) => (StatusCode::NOT_FOUND, msg),
|
||||
DomainError::Unauthorized(msg) => (StatusCode::UNAUTHORIZED, msg),
|
||||
DomainError::InfrastructureError(_) => {
|
||||
tracing::error!("Internal Infrastructure Error: {:?}", self.0);
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user