Skip to content
Discussion options

You must be logged in to vote

I think your reading is correct: WithHTTPSessionTransformer() is only on the HTTP response path, not on the session validation path.

The relevant flow is:

  • WithHTTPSessionTransformer() stores sessionTransformer in the HTTP config.
  • Responder.SessionResponse() calls it before writing the auth/session JSON response.
  • auth.GetSession(r) just calls SessionManager.ValidateSession(...) and returns *ValidatedSession.
  • MiddlewareRequireSession() also calls authInstance.GetSession(r) and then stores only User and Session in request context.

So the transformer does not mutate the stored session/user, and its extra fields will not appear later from auth.GetSession() or GetCurrentSessionFromCtx().

The …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Lakelimbo
Comment options

Answer selected by thecodearcher
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants