remove cookie flash-messages; simply show uuid

This commit is contained in:
2025-08-13 11:22:18 +02:00
parent e991818c7d
commit 652ea26b32
5 changed files with 89 additions and 242 deletions

View File

@@ -1,7 +1,6 @@
use crate::model::client::Client;
use axum::{http::HeaderMap, routing::get, Router};
use axum_extra::extract::{cookie::Cookie, CookieJar};
use axum_messages::MessagesManagerLayer;
use sqlx::{pool::PoolOptions, sqlite::SqliteConnectOptions, SqlitePool};
use std::{
collections::HashSet,
@@ -10,7 +9,6 @@ use std::{
sync::{Arc, LazyLock},
};
use tower_http::services::ServeDir;
use tower_sessions::{MemoryStore, SessionManagerLayer};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use uuid::Uuid;
@@ -199,9 +197,6 @@ async fn main() {
.with(EnvFilter::from_default_env())
.init();
let session_store = MemoryStore::default();
let session_layer = SessionManagerLayer::new(session_store).with_secure(false);
let connection_options = SqliteConnectOptions::from_str("sqlite://db.sqlite").unwrap();
let db: SqlitePool = PoolOptions::new()
.connect_with(connection_options)
@@ -212,9 +207,7 @@ async fn main() {
.route("/", get(index::index))
.nest_service("/static", ServeDir::new("./static/serve"))
.merge(game::routes())
.with_state(Arc::new(Backend::Sqlite(db)))
.layer(MessagesManagerLayer)
.layer(session_layer);
.with_state(Arc::new(Backend::Sqlite(db)));
// run our app with hyper, listening globally on port 3000
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();