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

allow /login to be accesed directly at session auth #23766

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ describe('login modal', () => {
it('greets with signin', () => {
cy.get(titleLoginSelector).should('be.visible');
});
<%_ if (clientFrameworkAngular) { _%>

it('greets visiting /login directly', () => {
cy.visit('/login');
cy.get(titleLoginSelector).should('be.visible');
});
<%_ } _%>

it('requires username', () => {
cy.get(passwordLoginSelector).type('a-password');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public class SecurityConfiguration {
)
.formLogin(formLogin ->
formLogin
.loginPage("/")
.loginProcessingUrl("/api/authentication")
.successHandler((request, response, authentication) -> response.setStatus(HttpStatus.OK.value()))
.failureHandler((request, response, exception) -> response.setStatus(HttpStatus.UNAUTHORIZED.value()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public class SecurityConfiguration {
<%_ } _%>
<%_ if (authenticationTypeSession) { _%>
.formLogin(formLogin -> formLogin
.loginPage("/")
.requiresAuthenticationMatcher(pathMatchers(HttpMethod.POST, "/api/authentication"))
.authenticationEntryPoint(new HttpStatusServerEntryPoint(HttpStatus.OK))
.authenticationSuccessHandler(this::onAuthenticationSuccess)
Expand Down