Skip to content

Commit

Permalink
use rand for secret
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcountryman committed Jul 26, 2022
1 parent 6a7950c commit f4b2301
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ features = ["cookie-signed"]
http = "0.2.8"
hyper = "0.14.19"

[dev-dependencies.rand]
version = "0.8.5"
features = ["min_const_gen"]

[dev-dependencies.tokio]
version = "1.19.2"
default-features = false
Expand Down
8 changes: 2 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
//! use axum_sessions::SessionLayer;
//! use http::{Request, Response};
//! use hyper::Body;
//! use rand::Rng;
//! use tower::{Service, ServiceBuilder, ServiceExt};
//!
//! async fn handle(request: Request<Body>) -> Result<Response<Body>, Infallible> {
Expand All @@ -61,12 +62,7 @@
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let store = async_session::MemoryStore::new();
//! let secret: Vec<u8> = ["_"]
//! .iter()
//! .cycle()
//! .take(64)
//! .flat_map(|s| s.as_bytes().to_owned())
//! .collect();
//! let secret = rand::thread_rng().gen::<[u8; 128]>();
//! let session_layer = SessionLayer::new(store, &secret);
//!
//! let mut service = ServiceBuilder::new()
Expand Down

0 comments on commit f4b2301

Please sign in to comment.