Skip to content

Commit b012402

Browse files
authored
Remove scheme + authority from login redirect URIs (#1625)
1 parent 0324bf2 commit b012402

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nexus/src/external_api/console_api.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,11 +586,17 @@ pub async fn console_index_or_login_redirect(
586586
// otherwise redirect to idp
587587

588588
// put the current URI in the query string to redirect back to after login
589-
let uri = rqctx.request.lock().await.uri().to_string();
589+
let uri = rqctx
590+
.request
591+
.lock()
592+
.await
593+
.uri()
594+
.path_and_query()
595+
.map(|p| p.to_string());
590596

591597
Ok(Response::builder()
592598
.status(StatusCode::FOUND)
593-
.header(http::header::LOCATION, get_login_url(Some(uri)))
599+
.header(http::header::LOCATION, get_login_url(uri))
594600
.body("".into())?)
595601
}
596602

0 commit comments

Comments
 (0)