redirect correctly on login, and save cookie to proper path

pull/8/head
Patrick Cleavelin 2023-08-01 00:09:22 -05:00
parent 83a0eadf6d
commit 25bb24694c
1 changed files with 2 additions and 2 deletions

View File

@ -222,10 +222,10 @@ pub(crate) async fn v2_auth(
// TODO: add permissions based on roles
let mut cookie = Cookie::new("access_token", token.clone());
cookie.set_path("/");
cookie.set_path(format!("{}/", state.origin));
cookie.set_secure(true);
Ok((jar.add(cookie), Redirect::to("/")))
Ok((jar.add(cookie), Redirect::to(&format!("{}/", state.origin))))
}
pub(crate) async fn auth(