api_v1_users - OmniCloudOrg/OmniOrchestrator GitHub Wiki

users (src/api/v1)

Path: src/api/v1/users.rs

Table of Contents

Public Items

async fn handle_register

Definition

pub async fn handle_register(
    pool: &State<Pool>, 
    data: String,
    cookies: &CookieJar<'_>,
    auth_config: &State<AuthConfig>
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Register a new user

async fn handle_login

Definition

pub async fn handle_login(
    pool: &State<Pool>, 
    auth_config: &State<AuthConfig>,
    data: String,
    cookies: &CookieJar<'_>
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Login a user

async fn get_current_user

Definition

pub async fn get_current_user(
    user: User,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Get the current user's profile

async fn update_profile

Definition

pub async fn update_profile(
    user: User,
    pool: &State<Pool>,
    data: String,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Update user profile information

async fn change_password

Definition

pub async fn change_password(
    user: User,
    pool: &State<Pool>,
    auth_config: &State<AuthConfig>,
    data: String,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Change user password

async fn logout

Definition

pub async fn logout(
    cookies: &CookieJar<'_>,
    _user: User, // Renamed to _user since we don't use it directly
    pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Logout the current user

async fn list_user_sessions

Definition

pub async fn list_user_sessions(
    user: User,
    pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

list all sessions for a user

async fn invalidate_user_session

Definition

pub async fn invalidate_user_session(
    user: User,
    session_id: String,
    pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Invalidate a specific session

async fn get_user_profile

Definition

pub async fn get_user_profile(
    user: User,
    pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Get the current user's complete profile including meta and PII data

async fn update_user_profile

Definition

pub async fn update_user_profile(
    user: User,
    pool: &State<Pool>,
    data: String,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

Update user profile information - handles both PII and meta updates in a single endpoint

async fn list_users

Definition

pub async fn list_users(
    page: Option<i64>,
    per_page: Option<i64>,
    pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
    // ... function body
}

Documentation

List all users

⚠️ **GitHub.com Fallback** ⚠️