Commit 17fdec39 authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Quickfix: Missing imports

parent 812ed96d
Pipeline #103 failed with stages
in 7 minutes and 14 seconds
......@@ -81,6 +81,8 @@ impl iron_sessionstorage::Value for SessionToken {
}
}
use iron::middleware::{AroundMiddleware, Handler};
pub struct CookieDistributor {}
impl CookieDistributor {
......@@ -89,7 +91,7 @@ impl CookieDistributor {
impl AroundMiddleware for CookieDistributor {
fn around(self, handler: Box<Handler>) -> Box<Handler> {
use iron::middleware::{AroundMiddleware, Handler};
use rand::{distributions::Alphanumeric, thread_rng, Rng};
Box::new(move |req: &mut Request| -> IronResult<Response> {
......@@ -130,7 +132,7 @@ impl<'a, 'b> RequestSession for Request<'a, 'b> {
match self.session().get::<SessionToken>().unwrap() {
Some(SessionToken { token: session }) => Ok(session),
_ => {
use rand::{thread_rng, Rng};
use rand::{distributions::Alphanumeric, thread_rng, Rng};
let new_session_key: String = thread_rng().sample_iter(&Alphanumeric).take(28).collect();
self.session().set(SessionToken { token: new_session_key }).unwrap();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment