Implementing loginform with react issue

I’m trying to implement SpringBoot Security’s LoginForm and have it talk with my react application. I’m currently following the tutorial below:

Baeldung Spring Security Login

I’ve reached the part where it talks about implementing the configuration for the LoginForm itself. It states the following code:

http
      // ...
      .and()
      .formLogin()
      .loginPage("/login.html")
      .loginProcessingUrl("/perform_login")
      .defaultSuccessUrl("/homepage.html", true)
      .failureUrl("/login.html?error=true")
      .failureHandler(authenticationFailureHandler())
      .and()
      .logout()
      .logoutUrl("/perform_logout")
      .deleteCookies("JSESSIONID")
      .logoutSuccessHandler(logoutSuccessHandler());

The main part of that to take away is the authenticationFailureHandler() and the logoutSuccessHandler() methods.

Neither of them exist within WebSecurityConfigurerAdapter, nor does the article actually implement them. Do I have to create a customer version of both in this instance?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

At the bottom of the article, they provide a link to their GitHub project containing all of the code from the article.

Here is a link to file of this project, containing the code you mention.

But in short, they do implement a custom version of it.

Also, it seems that tihs question was accidentally mistakenly tagged with react.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x