Merge branch 'main' into hf/towards-a-working-spawn

This commit is contained in:
dr-frmr 2023-10-12 14:12:40 -04:00
commit 1c8ae26c6d
No known key found for this signature in database

View File

@ -171,10 +171,7 @@ pub async fn login(
port: u16,
) {
let login_page = include_str!("login.html");
let redirect_to_login =
warp::path::end().map(|| warp::redirect(warp::http::Uri::from_static("/login")));
let routes = warp::path("login")
.and(
let routes = warp::path("login").and(
// 1. serve login.html right here
warp::get()
.map(move || warp::reply::html(login_page))
@ -186,8 +183,7 @@ pub async fn login(
.and(warp::any().map(move || keyfile.clone()))
.and(warp::any().map(move || tx.clone()))
.and_then(handle_password)),
)
.or(redirect_to_login);
);
let _ = open::that(format!("http://localhost:{}/login", port));
warp::serve(routes)