refactoring token -> claim processing

This commit is contained in:
2026-01-03 17:15:34 +01:00
parent c0d70077d7
commit 170fedbcbd
12 changed files with 95 additions and 60 deletions

View File

@@ -50,22 +50,22 @@ async fn main() -> std::io::Result<()> {
dotenv().ok();
std::panic::set_hook(Box::new(|info| {
let msg = format!("Rust panic: {}", info);
std::panic::set_hook(Box::new(|info| {
let msg = format!("Rust panic: {}", info);
// Use blocking client so the process can't exit before sending
let payload = serde_json::json!({
"content": msg
});
// Use blocking client so the process can't exit before sending
let payload = serde_json::json!({
"content": msg
});
let client = reqwest::blocking::Client::new();
let _ = client
.post("https://discord.com/api/webhooks/1440912618205347891/Ekg89krDoPm41kA27LA3gXgNWmMWvCCtziYIUsjqaY22Jnw4a6IWhZOht0in5JjnPX-W")
.json(&payload)
.send();
}));
let client = reqwest::blocking::Client::new();
let _ = client
.post("https://discord.com/api/webhooks/1440912618205347891/Ekg89krDoPm41kA27LA3gXgNWmMWvCCtziYIUsjqaY22Jnw4a6IWhZOht0in5JjnPX-W")
.json(&payload)
.send();
}));
//panic!("crash-test");
//panic!("crash-test");
let hotel_pools = HotelPool::new();
let logs_manager = SqliteConnectionManager::file("db/auth_copy_2.sqlite");
@@ -92,15 +92,15 @@ std::panic::set_hook(Box::new(|info| {
decoding: DecodingKey::from_secret(jwt_secret.as_ref()),
};
let allowed_origins = vec![
"http://82.66.253.209",
"http://localhost:5173",
];
let allowed_origins = vec![
"http://82.66.253.209",
"http://localhost:5173",
];
let cors = CorsLayer::very_permissive()
.allow_credentials(true)
.allow_methods([Method::GET, Method::POST, Method::PUT, Method::OPTIONS])
.allow_headers([CONTENT_TYPE, AUTHORIZATION]);
let cors = CorsLayer::very_permissive()
.allow_credentials(true)
.allow_methods([Method::GET, Method::POST, Method::PUT, Method::OPTIONS])
.allow_headers([CONTENT_TYPE, AUTHORIZATION]);
let app = create_router(state)
.layer(Extension(jwt_keys))
.layer(cors);
@@ -110,6 +110,6 @@ let cors = CorsLayer::very_permissive()
Ok(())
}
async fn handler() -> &'static str {
"Hiii from localhost"
}
async fn handler() -> &'static str {
"Hiii from localhost"
}