Skip to content

Commit

Permalink
Add redirect to the new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
enaut committed Jul 13, 2021
1 parent 64d9448 commit 1bbea2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pslink/src/bin/pslink/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 9 additions & 0 deletions pslink/src/bin/pslink/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down

0 comments on commit 1bbea2a

Please sign in to comment.