Skip to content

Commit

Permalink
Merge pull request #23766 from mshima/skip_ci-session
Browse files Browse the repository at this point in the history
allow /login to be accesed directly at session auth
  • Loading branch information
DanielFran authored Oct 7, 2023
2 parents 8689b26 + 7f478b7 commit 7cfaf0e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
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

0 comments on commit 7cfaf0e

Please sign in to comment.