Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the auth login response payload so the returned user object matches the richer shape used by the /api/me endpoint, allowing the frontend to reliably load team/division state immediately after first login.
Changes:
- Replaced the bespoke
loginUserResponsestruct with a type alias touserMeResponse. - Updated the login handler to return
newUserMeResponse(user)(including team/division + blocked fields). - Strengthened handler/integration tests and updated auth docs to reflect the expanded login response.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/http/integration/testenv_test.go | Integration helpers now assert team_id/team_name exist in login responses. |
| internal/http/handlers/types.go | Makes login’s user payload identical to userMeResponse via type alias. |
| internal/http/handlers/handler_test.go | Handler test asserts login response includes the new team/division/blocked fields. |
| internal/http/handlers/handler.go | Login endpoint now reuses newUserMeResponse for response shaping. |
| docs/docs/auth.md | Updates login response example to include team and blocked fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Align Login API Response with
GET /mePreviously, the login response did not include team-related information. As a result, the frontend could not load the user’s team on the first login, causing solved challenges not to appear correctly.
To resolve this, the login response has been updated so that the
userfield is consistent withGET /users, as shown below.{ "access_token": "<jwt>", "refresh_token": "<jwt>", "user": { "id": 1, "email": "user@example.com", "username": "user1", "role": "user", "team_id": 3, "team_name": "team-alpha", "division_id": 2, "division_name": "고등부", "blocked_reason": null, "blocked_at": null } }