diff --git a/nexus/src/external_api/console_api.rs b/nexus/src/external_api/console_api.rs index ada514bcb68..e31eecb6012 100644 --- a/nexus/src/external_api/console_api.rs +++ b/nexus/src/external_api/console_api.rs @@ -60,7 +60,7 @@ pub struct SpoofLoginBody { pub async fn login_spoof( rqctx: Arc>>, params: TypedBody, -) -> Result { +) -> Result, HttpError> { let apictx = rqctx.context(); let handler = async { let nexus = &apictx.nexus; @@ -85,7 +85,8 @@ pub async fn login_spoof( let authn_opctx = nexus.opctx_external_authn(); let session = nexus.session_create(&authn_opctx, user_id).await?; - let mut response = http_response_see_other(String::from("/"))?; + let mut response = + HttpResponseHeaders::new_unnamed(HttpResponseUpdatedNoContent()); { let headers = response.headers_mut(); headers.append( diff --git a/nexus/tests/integration_tests/console_api.rs b/nexus/tests/integration_tests/console_api.rs index 2094a105c55..77e796507ee 100644 --- a/nexus/tests/integration_tests/console_api.rs +++ b/nexus/tests/integration_tests/console_api.rs @@ -398,7 +398,7 @@ fn get_header_value(resp: TestResponse, header_name: HeaderName) -> String { async fn log_in_and_extract_token(testctx: &ClientTestContext) -> String { let login = RequestBuilder::new(&testctx, Method::POST, "/login") .body(Some(&SpoofLoginBody { username: "unprivileged".to_string() })) - .expect_status(Some(StatusCode::SEE_OTHER)) + .expect_status(Some(StatusCode::NO_CONTENT)) .execute() .await .expect("failed to log in"); diff --git a/openapi/nexus.json b/openapi/nexus.json index b91b2fd282a..60613076261 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -547,18 +547,8 @@ "required": true }, "responses": { - "303": { - "description": "redirect (see other)", - "headers": { - "location": { - "description": "HTTP \"Location\" header", - "style": "simple", - "required": true, - "schema": { - "type": "string" - } - } - } + "204": { + "description": "resource updated" }, "4XX": { "$ref": "#/components/responses/Error"