diff --git a/src/account.rs b/src/account.rs index 12077f0..c89f393 100644 --- a/src/account.rs +++ b/src/account.rs @@ -36,23 +36,6 @@ pub fn is_logged_in(req: &HttpRequest) -> Option<&str> { } } -pub fn has_admintoken(req: &HttpRequest) -> Option { - get_cookie(req, "sncf_admin_token") -} - -pub fn has_csrftoken(req: &HttpRequest) -> Option { - get_cookie(req, "sncf_csrf_cookie") -} - -fn get_cookie(req: &HttpRequest, cookie_name: &str) -> Option { - let c = req.headers().get("Cookie")?.to_str().ok()?; - if c.contains(cookie_name) { - Some(c.to_string()) - } else { - None - } -} - // attempts to create the account from Nextcloud's API // returns the newly created username. // if it fails (bad return code), returns None. @@ -207,8 +190,6 @@ pub async fn login( str_cookiepair.push_str(&format!("{}={}; ", cookie_k, cookie_v)); } - println!("SET-COOKIE: {}", str_cookiepair); - // load requesttoken regex lazy_static! { static ref RE: Regex = Regex::new(r#"\{"token":"(?P[^"]*)"\}"#)