Skip to content

Remove scheme + authority from login redirect URIs #1625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions nexus/src/external_api/console_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,17 @@ pub async fn console_index_or_login_redirect(
// otherwise redirect to idp

// put the current URI in the query string to redirect back to after login
let uri = rqctx.request.lock().await.uri().to_string();
let uri = rqctx
.request
.lock()
.await
.uri()
.path_and_query()
.map(|p| p.to_string());

Ok(Response::builder()
.status(StatusCode::FOUND)
.header(http::header::LOCATION, get_login_url(Some(uri)))
.header(http::header::LOCATION, get_login_url(uri))
.body("".into())?)
}

Expand Down