mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 13:01:12 +03:00
+ log files
+ more control on auth providers + server info in motd + bans and parsing minecraft server blacklist + more error handling + panic hook to tracing
This commit is contained in:
parent
bd101fc3fa
commit
d45a495cbf
21 changed files with 748 additions and 378 deletions
|
|
@ -1,25 +1,20 @@
|
|||
use axum::{
|
||||
extract::State,
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Response},
|
||||
Json
|
||||
};
|
||||
use tracing::debug;
|
||||
|
||||
use crate::{auth::{Token, Userinfo}, AppState};
|
||||
use crate::{auth::{Token, Userinfo}, ApiResult, AppState};
|
||||
|
||||
pub(super) async fn create_user(
|
||||
Token(token): Token,
|
||||
State(state): State<AppState>,
|
||||
Json(json): Json<Userinfo>
|
||||
) -> Response {
|
||||
match state.config.lock().await.clone().verify_token(&token) {
|
||||
Ok(_) => {},
|
||||
Err(e) => return e,
|
||||
}
|
||||
) -> ApiResult<&'static str> {
|
||||
state.config.read().await.clone().verify_token(&token)?;
|
||||
|
||||
debug!("Creating new user: {json:?}");
|
||||
|
||||
state.user_manager.insert_user(json.uuid, json);
|
||||
(StatusCode::OK, "ok".to_string()).into_response()
|
||||
Ok("ok")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue