fix: redirect to dashboard homepage if user is authenticated

This commit is contained in:
Aravinth Manivannan 2022-12-03 14:57:08 +05:30
parent cdeabb06aa
commit 6660602ab6
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
2 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ pub async fn login_submit(
.finish())
} else {
Ok(HttpResponse::Found()
.insert_header((http::header::LOCATION, PAGES.home))
.insert_header((http::header::LOCATION, PAGES.dash.home))
.finish())
}
}

View File

@ -71,7 +71,7 @@ async fn auth_works(ctx: ArcCtx) {
.await;
assert_eq!(resp.status(), StatusCode::FOUND);
let headers = resp.headers();
assert_eq!(headers.get(header::LOCATION).unwrap(), PAGES.home);
assert_eq!(headers.get(header::LOCATION).unwrap(), PAGES.dash.home);
let cookies = get_cookie!(resp);
// redirect after signin