we compiled

This commit is contained in:
filipriec
2025-03-24 22:03:04 +01:00
parent 70d83c284a
commit 3ed6fd4ee8
3 changed files with 17 additions and 19 deletions

View File

@@ -1,26 +1,19 @@
// src/auth/models.rs
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use validator::Validate;
#[derive(Debug, Validate, Deserialize)]
pub struct RegisterRequest {
#[validate(length(min = 3, max = 30))]
#[validate(length(min = 1, max = 30))]
pub username: String,
#[validate(email)]
pub email: String,
#[validate(length(min = 8))]
#[validate(length(min = 1))]
pub password: String,
pub password_confirmation: String,
}
#[derive(Debug, Serialize)]
pub struct AuthResponse {
pub id: Uuid,
pub username: String,
pub email: String,
pub role: String,
}
#[derive(Debug, thiserror::Error)]
pub enum AuthError {
#[error("Passwords do not match")]