mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 04:51:13 +03:00
+ more control on auth providers + server info in motd + bans and parsing minecraft server blacklist + more error handling + panic hook to tracing
20 lines
No EOL
457 B
Rust
20 lines
No EOL
457 B
Rust
use axum::{
|
|
extract::State,
|
|
Json
|
|
};
|
|
use tracing::debug;
|
|
|
|
use crate::{auth::{Token, Userinfo}, ApiResult, AppState};
|
|
|
|
pub(super) async fn create_user(
|
|
Token(token): Token,
|
|
State(state): State<AppState>,
|
|
Json(json): Json<Userinfo>
|
|
) -> ApiResult<&'static str> {
|
|
state.config.read().await.clone().verify_token(&token)?;
|
|
|
|
debug!("Creating new user: {json:?}");
|
|
|
|
state.user_manager.insert_user(json.uuid, json);
|
|
Ok("ok")
|
|
} |