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

SpringSecurityAuthenticationManager should return Optional.empty() if no user is logged in #76

Closed
AndreasZaschka opened this issue Dec 16, 2014 · 0 comments
Assignees
Milestone

Comments

@AndreasZaschka
Copy link

Should return Optional.empty(), not null.

odrotbohm added a commit that referenced this issue Dec 18, 2014
… returns Optionals.

In case no Authentication was present, SpringSecurityAuthenticationManager returned null which is invalid for methods returning Optional. We now return Optional.empty().
odrotbohm added a commit that referenced this issue Dec 18, 2014
Some cleanups in PersistentUserAccountManager, use of lambdas in SpringSecurityAuthenticationManager. Introduced UserAccount.getUsername() to avoid leaking internals via the identifier.
odrotbohm added a commit that referenced this issue Dec 18, 2014
… returns Optionals.

In case no Authentication was present, SpringSecurityAuthenticationManager returned null which is invalid for methods returning Optional. We now return Optional.empty().
odrotbohm added a commit that referenced this issue Dec 18, 2014
Some cleanups in PersistentUserAccountManager, use of lambdas in SpringSecurityAuthenticationManager. Introduced UserAccount.getUsername() to avoid leaking internals via the identifier.
@odrotbohm odrotbohm self-assigned this Dec 18, 2014
@odrotbohm odrotbohm added this to the 6.1.1 milestone Dec 18, 2014
@odrotbohm odrotbohm changed the title SpringSecurityAuthenticationManager#getCurrentUser wrong return type SpringSecurityAuthenticationManager should return Optional.empty() if no user is logged in Dec 18, 2014
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

No branches or pull requests

2 participants