prisma_auth 0.2.1

A simple authentication crate supporting both Rocket backend API and Yew frontend authentication components
Documentation
// src/error.rs
use thiserror::Error;

/// Authentication and authorization errors
#[derive(Error, Debug)]
pub enum AuthError {
    #[error("Invalid credentials")]
    InvalidCredentials,

    #[error("Token not found")]
    TokenNotFound,

    #[error("Token expired")]
    TokenExpired,

    #[error("Invalid token format")]
    InvalidTokenFormat,

    #[error("Storage error: {0}")]
    StorageError(String),

    #[error("Network error: {0}")]
    NetworkError(String),

    #[error("Serialization error: {0}")]
    SerializationError(String),

    #[error("User not found")]
    UserNotFound,

    #[error("User already exists")]
    UserAlreadyExists,

    #[error("Role not found")]
    RoleNotFound,

    #[error("Permission denied")]
    PermissionDenied,

    #[error("Password requirements not met: {0}")]
    WeakPassword(String),
}