api_v1_users - OmniCloudOrg/OmniOrchestrator GitHub Wiki
Path: src/api/v1/users.rs
- async fn handle_register
- async fn handle_login
- async fn get_current_user
- async fn update_profile
- async fn change_password
- async fn logout
- async fn list_user_sessions
- async fn invalidate_user_session
- async fn get_user_profile
- async fn update_user_profile
- async fn list_users
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
}
Register a new user
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
}
Login a user
pub async fn get_current_user(
user: User,
) -> Result<rocket::serde::json::Value, Custom<String>> {
// ... function body
}
Get the current user's profile
pub async fn update_profile(
user: User,
pool: &State<Pool>,
data: String,
) -> Result<rocket::serde::json::Value, Custom<String>> {
// ... function body
}
Update user profile information
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
}
Change user password
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
}
Logout the current user
pub async fn list_user_sessions(
user: User,
pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
// ... function body
}
list all sessions for a user
pub async fn invalidate_user_session(
user: User,
session_id: String,
pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
// ... function body
}
Invalidate a specific session
pub async fn get_user_profile(
user: User,
pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
// ... function body
}
Get the current user's complete profile including meta and PII data
pub async fn update_user_profile(
user: User,
pool: &State<Pool>,
data: String,
) -> Result<rocket::serde::json::Value, Custom<String>> {
// ... function body
}
Update user profile information - handles both PII and meta updates in a single endpoint
pub async fn list_users(
page: Option<i64>,
per_page: Option<i64>,
pool: &State<Pool>,
) -> Result<rocket::serde::json::Value, Custom<String>> {
// ... function body
}
List all users