1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-05-12 14:47:46 +00:00

Redirect to account management page after signing up

See #17
This commit is contained in:
Joshua Goins 2025-05-06 15:41:55 -04:00
parent ca8d36e48c
commit 014fc0beea

View file

@ -128,9 +128,10 @@ struct RegisterInput {
} }
async fn do_register( async fn do_register(
jar: CookieJar,
State(state): State<LoginServerState>, State(state): State<LoginServerState>,
Form(input): Form<RegisterInput>, Form(input): Form<RegisterInput>,
) -> Redirect { ) -> (CookieJar, Redirect) {
tracing::info!( tracing::info!(
"Registering with {:#?} and {:#?}!", "Registering with {:#?} and {:#?}!",
input.username, input.username,
@ -146,7 +147,15 @@ async fn do_register(
state.database.add_user(&username, &password); state.database.add_user(&username, &password);
Redirect::to("/") // redirect to account management page
let sid = state.database.login_user(&username, &password).unwrap();
let cookie = Cookie::build(("cis_sessid", sid))
.path("/")
.secure(false)
.expires(Expiration::Session)
.http_only(true);
(jar.add(cookie), Redirect::to("/account/app/svc/manage"))
} }
#[derive(Deserialize)] #[derive(Deserialize)]