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

This commit is contained in:
neil 2021-04-15 23:43:17 +02:00
parent 002a0c9ef2
commit e354b5b14b
1 changed files with 1 additions and 15 deletions

View File

@ -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| {