Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass createSession to native getSession call #533

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

amaechler
Copy link
Contributor

@amaechler amaechler commented Apr 22, 2024

As discussed on pac4j-dev, this PR updates the ServletSessionStore to pass a createSession parameter to the "native" getSession function. This mimics the implementation of other session stores, and should also prevent an IllegalStateException from being thrown (originally addressed in c0b55af).

In addition to passing createSession, I also

  • renamed getHttpSession to getNativeSession to align naming with the JEESessionStore
  • used additional Optional syntax (map, filter, ...) instead of conditionals
  • removed the protected httpSession and its constructor, because buildFromTrackableSession creates a store with that session inline already

If those changes seem too much, I can undo those of course.

Once this PR is in, I'll create a backport PR targeting the 5.0.x branch.

* Pass createSession variable
* Use Optional.of
* Use final everywhere for params
* Make getNativeSession return Optional
@leleuj
Copy link
Member

leleuj commented Apr 23, 2024

LGTM

@leleuj leleuj merged commit 25dec08 into pac4j:master Apr 23, 2024
3 checks passed
@leleuj
Copy link
Member

leleuj commented Apr 23, 2024

The v6.0.1 release is in progress...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants