mirror of
https://git.42l.fr/neil/sncf.git
synced 2024-04-26 03:20:29 +02:00
force redirection from /apps/files to /apps/forms
This commit is contained in:
parent
d6a4a6591a
commit
7fbfcf485c
|
@ -31,7 +31,14 @@ pub async fn forward(
|
|||
// if check_route returns true,
|
||||
// the user supposedly tried to access a restricted page.
|
||||
// They get redirected to the main page.
|
||||
if check_route(route) {
|
||||
if route == "/apps/files" {
|
||||
// exception for /apps/files: always redirect to /apps/forms
|
||||
debug(&format!("Files route blocked: {}", route));
|
||||
return Ok(web_redir("/apps/forms").await.map_err(|e| {
|
||||
eprintln!("error_redirect: {}", e);
|
||||
crash(get_lang(&req), "error_redirect")
|
||||
})?);
|
||||
} else if check_route(route) {
|
||||
debug(&format!("Restricted route blocked: {}", route));
|
||||
return Ok(web_redir("/").await.map_err(|e| {
|
||||
eprintln!("error_redirect: {}", e);
|
||||
|
|
Loading…
Reference in a new issue