update: src/main.rs

This commit is contained in:
maix0 2025-01-16 00:03:52 +01:00
parent 9d1e56d2dc
commit 7d798347da

View file

@ -153,10 +153,10 @@ async fn oauth2_callback(
) -> Result<impl IntoResponse, StatusCode> { ) -> Result<impl IntoResponse, StatusCode> {
let inner = || async { let inner = || async {
let Some(code) = params.get("code") else { let Some(code) = params.get("code") else {
return Ok::<_, color_eyre::eyre::Report>((jar, Redirect::to("/"))); return Ok::<_, color_eyre::eyre::Report>((jar, Redirect::to("/manager")));
}; };
let Some(state_csrf) = params.get("state") else { let Some(state_csrf) = params.get("state") else {
return Ok((jar, Redirect::to("/"))); return Ok((jar, Redirect::to("/manager")));
}; };
let token = state let token = state
.oauth .oauth
@ -181,7 +181,7 @@ async fn oauth2_callback(
// cookie.set_domain("localhost:3000"); // cookie.set_domain("localhost:3000");
// cookie.set_http_only(Some(false)); // cookie.set_http_only(Some(false));
let ujar = jar.add(cookie); let ujar = jar.add(cookie);
Ok((ujar, Redirect::to("/"))) Ok((ujar, Redirect::to("/manager")))
}; };
match inner().await { match inner().await {
Ok(ret) => Ok(ret), Ok(ret) => Ok(ret),
@ -278,7 +278,7 @@ async fn restart(_user: UserLoggedIn) -> Redirect {
.spawn() .spawn()
.unwrap() .unwrap()
}); });
Redirect::to("/") Redirect::to("/manager")
} }
async fn start(_user: UserLoggedIn) -> Redirect { async fn start(_user: UserLoggedIn) -> Redirect {
@ -289,7 +289,7 @@ async fn start(_user: UserLoggedIn) -> Redirect {
.spawn() .spawn()
.unwrap() .unwrap()
}); });
Redirect::to("/") Redirect::to("/manager")
} }
async fn stop(_user: UserLoggedIn) -> Redirect { async fn stop(_user: UserLoggedIn) -> Redirect {
@ -300,7 +300,7 @@ async fn stop(_user: UserLoggedIn) -> Redirect {
.spawn() .spawn()
.unwrap() .unwrap()
}); });
Redirect::to("/") Redirect::to("/manager")
} }
async fn status() -> Result<String, StatusCode> { async fn status() -> Result<String, StatusCode> {