diff --git a/cms/src/auth.rs b/cms/src/auth.rs index f4057ed..9dc4568 100644 --- a/cms/src/auth.rs +++ b/cms/src/auth.rs @@ -5,7 +5,7 @@ use oauth2::{ }; use reqwest::blocking::Client; use rocket::{ - http::{Cookie, Cookies, SameSite, Status}, + http::{Cookie, Cookies, Status}, request, request::FromRequest, response::Redirect, @@ -170,7 +170,7 @@ pub fn callback( }; if auths.into_iter().any(|x| x == email.as_str().unwrap_or("")) { let mut cook = Cookie::new("token", secret.to_string()); - cook.set_same_site(SameSite::Strict); + // cook.set_same_site(SameSite::Strict); cook.set_http_only(true); cook.set_secure(true); cookies.add(cook); diff --git a/cms/src/data/mod.rs b/cms/src/data/mod.rs index 58f285b..27af4c3 100644 --- a/cms/src/data/mod.rs +++ b/cms/src/data/mod.rs @@ -125,14 +125,6 @@ pub mod defs { type Error = (); fn from_form_value(value: &'v RawStr) -> Result { - /* - println!("{:?}", value); - let file = NamedFile::open(value.to_string()); - println!("{:?}", file); - - Ok(Image(String::from("pepega"))) - */ - let value_uri = match value.url_decode() { Ok(n) => n, Err(_) => return Err(()), diff --git a/cms/src/main.rs b/cms/src/main.rs index 16c36bb..233a0fe 100644 --- a/cms/src/main.rs +++ b/cms/src/main.rs @@ -73,7 +73,7 @@ fn rocket(port: u16, address: String, env: Environment, pg: PgConnection, sa: Se .manage(sa) .mount( "/", - routes![home, home_not_logged_in, login, auth::callback, auth::oauth, static_files], + routes![home, home_not_logged_in, login, auth::callback, auth::oauth, static_files, auth::logout], ) .mount("/api", routes![ data::student::api, diff --git a/cms/templates/home.html.hbs b/cms/templates/home.html.hbs index 098957f..7953eae 100644 --- a/cms/templates/home.html.hbs +++ b/cms/templates/home.html.hbs @@ -6,6 +6,8 @@ + Logout +
Events New Announcements