Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions nexus/src/external_api/console_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub struct SpoofLoginBody {
pub async fn login_spoof(
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
params: TypedBody<SpoofLoginBody>,
) -> Result<HttpResponseSeeOther, HttpError> {
) -> Result<HttpResponseHeaders<HttpResponseUpdatedNoContent>, HttpError> {
let apictx = rqctx.context();
let handler = async {
let nexus = &apictx.nexus;
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion nexus/tests/integration_tests/console_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
14 changes: 2 additions & 12 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down