Add redirect to the new interface
This commit is contained in:
parent
b9a02b1740
commit
2b276a5130
@ -166,7 +166,8 @@ pub async fn webservice(
|
||||
web::post().to(views::get_logged_user_json),
|
||||
)
|
||||
.route("/login_user/", web::post().to(views::process_login_json)),
|
||||
),
|
||||
)
|
||||
.default_service(web::to(views::to_admin)),
|
||||
)
|
||||
// Serve the Wasm App for the admin interface.
|
||||
.service(
|
||||
|
@ -308,6 +308,15 @@ pub async fn logout(id: Identity) -> Result<HttpResponse, ServerError> {
|
||||
Ok(redirect_builder("/app/"))
|
||||
}
|
||||
|
||||
#[instrument()]
|
||||
pub async fn to_admin() -> Result<HttpResponse, ServerError> {
|
||||
let response = HttpResponse::PermanentRedirect()
|
||||
.set_header(actix_web::http::header::LOCATION, "/app/")
|
||||
.body(r#"The admin interface moved to <a href="/app/">/app/</a>"#);
|
||||
|
||||
Ok(response)
|
||||
}
|
||||
|
||||
#[instrument()]
|
||||
pub async fn redirect(
|
||||
config: web::Data<crate::ServerConfig>,
|
||||
|
Reference in New Issue
Block a user