Browse Source

remove token check when clicking on the new form button on index

root
neil 4 weeks ago
parent
commit
e354b5b14b
  1. 16
      src/forward.rs

16
src/forward.rs

@ -210,21 +210,7 @@ pub async fn forward_register(
) -> Result<HttpResponse, TrainCrash> {
let lang = get_lang(&req);
let cookie_admin_token = s.get::<String>("sncf_admin_token").map_err(|e| {
eprintln!("error_forwardregister_tokenparse: {}", e);
crash(get_lang(&req), "error_forwardregister_tokenparse")
})?;
// if the user has already generated an admin token, redirect too
if let Some(admin_token) = cookie_admin_token {
return Ok(
web_redir(&format!("{}/admin/{}", CONFIG.sncf_url, &admin_token))
.await
.map_err(|e| {
eprintln!("error_redirect (admin): {}", e);
crash(get_lang(&req), "error_redirect")
})?,
);
}
// do not check for existing admin tokens and force a new registration
// check if the csrf token is OK
let cookie_csrf_token = s.get::<String>("sncf_csrf_token").map_err(|e| {

Loading…
Cancel
Save