Skip to content

fix: Return 201 Created from SignUp endpoint#279

Closed
nbhansen wants to merge 1 commit intoaau-giraf:dev-mainfrom
nbhansen:fix/signup-rest-violation
Closed

fix: Return 201 Created from SignUp endpoint#279
nbhansen wants to merge 1 commit intoaau-giraf:dev-mainfrom
nbhansen:fix/signup-rest-violation

Conversation

@nbhansen
Copy link
Contributor

@nbhansen nbhansen commented Feb 4, 2026

Summary

  • Changes SignUp endpoint to return HTTP 201 (Created) instead of HTTP 200 (OK)
  • Follows REST conventions for resource creation endpoints
  • Adds Location header pointing to the newly created user resource
  • Updates test helpers and test assertions to expect 201

Test plan

  • Build passes
  • All 98 existing tests pass (updated to expect 201)
  • Verified Location header is returned with correct URI

REST best practice: POST endpoints that create resources should return
201 Created with a Location header, not 200 OK.

- Modified UsersController.SingUp to return CreatedAtAction pointing to
  GetUser endpoint
- Refactored AutoSignIn helper to GenerateLoginResponse for clarity
- Updated all test assertions to expect HttpStatusCode.Created
- Removed TODO comments about this issue from tests and Utilities.cs

All 98 tests passing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@nbhansen nbhansen force-pushed the fix/signup-rest-violation branch from 85a61ed to 4a56d31 Compare February 4, 2026 14:06
@nbhansen nbhansen closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant