Repository navigation
feat: answer signed-out GET /users/me with 204 - #32
Merged
Merged
Conversation
GET /users/me is now public and returns 204 No Content when there is no session, instead of the 401 that Chrome logs as a failed request on every signed-out page load. Signed-in callers get their profile as before. Only the exact GET /users/me route is opened; /users/me/preferences, /users/me/accounts and /users/me/legal-agreement still require a session, and a test covers that. Signed-out calls create no session and responses stay no-store. The absolute-timeout test now checks a protected route for the 401, and a new test checks /users/me returns 204 after expiry.
alexmcdermid
force-pushed
the
fix/public-session-check
branch
from
October 17, 2026 17:14
0ae9a15 to
eb4ecd7
Compare
This branch was successfully deployed
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.
Stops the signed-out page load from logging
GET /api/v1/users/me 401 (Unauthorized).GET /api/v1/users/meis now public:UserProfileResponseas before.Safety:
GET /users/meroute is opened (requestMatchers(HttpMethod.GET, ApiPaths.USER_ME))./users/me/preferences,/users/me/accountsand/users/me/legal-agreementstill require a session. A new test covers that; it fails if the rule is widened to/users/me/**.no-store, so a proxy can't cache one user's profile for another.AbsoluteSessionTimeoutFilter) is cleared before the controller runs and gets a 204.LegalAgreementFilteralready exemptedGET /users/me, so users who haven't accepted the terms still get their profile.No merge order: the frontend change (alexmcdermid/tradingView#50) treats both 204 and the old 401 as signed out.
Testing:
mvn -B test: 129 passing. NewAuthControllerTestcases: signed out → 204 with no session or cookie andno-store;/users/me/*sub-routes still 401 when signed out; expired session → 204. The absolute-timeout test now checks a protected route for its 401.