mirror of
https://git.42l.fr/neil/sncf.git
synced 2024-05-04 06:53:12 +02:00
remove token check when clicking on the new form button on index
This commit is contained in:
parent
002a0c9ef2
commit
e354b5b14b
|
@ -210,21 +210,7 @@ pub async fn forward_register(
|
||||||
) -> Result<HttpResponse, TrainCrash> {
|
) -> Result<HttpResponse, TrainCrash> {
|
||||||
let lang = get_lang(&req);
|
let lang = get_lang(&req);
|
||||||
|
|
||||||
let cookie_admin_token = s.get::<String>("sncf_admin_token").map_err(|e| {
|
// do not check for existing admin tokens and force a new registration
|
||||||
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")
|
|
||||||
})?,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if the csrf token is OK
|
// check if the csrf token is OK
|
||||||
let cookie_csrf_token = s.get::<String>("sncf_csrf_token").map_err(|e| {
|
let cookie_csrf_token = s.get::<String>("sncf_csrf_token").map_err(|e| {
|
||||||
|
|
Loading…
Reference in a new issue