From 25bb24694c890db9e920aabba65ab18e9bf12186 Mon Sep 17 00:00:00 2001 From: Patrick Cleavelin Date: Tue, 1 Aug 2023 00:09:22 -0500 Subject: [PATCH] redirect correctly on login, and save cookie to proper path --- src/routes.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes.rs b/src/routes.rs index ae10ac7..2922df6 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -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(