Skip to content

Commit 877d335

Browse files
author
Eugen
committed
Merge pull request eugenp#182 from Doha2012/master
fix redirection error
2 parents deac787 + 0e2451c commit 877d335

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

spring-security-login-and-registration/src/main/java/org/baeldung/spring/SecSecurityConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ public SecSecurityConfig() {
3131
}
3232

3333
@Override
34-
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
34+
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
3535
auth.authenticationProvider(authProvider());
3636
}
3737

3838
@Override
39-
public void configure(WebSecurity web) throws Exception {
39+
public void configure(final WebSecurity web) throws Exception {
4040
web.ignoring().antMatchers("/resources/**");
4141
}
4242

4343
@Override
44-
protected void configure(HttpSecurity http) throws Exception {
44+
protected void configure(final HttpSecurity http) throws Exception {
4545
// @formatter:off
4646
http
4747
.csrf().disable()
4848
.authorizeRequests()
4949
.antMatchers("/j_spring_security_check*","/login*", "/logout*", "/signin/**", "/signup/**",
5050
"/user/registration*", "/regitrationConfirm*", "/expiredAccount*", "/registration*",
5151
"/badUser*", "/user/resendRegistrationToken*" ,"/forgetPassword*", "/user/resetPassword*",
52-
"/user/changePassword*", "/emailError*", "/resources/**","/old/user/registration*").permitAll()
52+
"/user/changePassword*", "/emailError*", "/resources/**","/old/user/registration*","/successRegister*").permitAll()
5353
.antMatchers("/invalidSession*").anonymous()
5454
.anyRequest().authenticated()
5555
.and()
@@ -80,7 +80,7 @@ protected void configure(HttpSecurity http) throws Exception {
8080

8181
@Bean
8282
public DaoAuthenticationProvider authProvider() {
83-
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
83+
final DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
8484
authProvider.setUserDetailsService(userDetailsService);
8585
authProvider.setPasswordEncoder(encoder());
8686
return authProvider;

spring-security-login-and-registration/src/main/webapp/WEB-INF/view/registration.jsp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,15 @@ color:#000;
6666
$(document).ready(function () {
6767
options = {
6868
common: {minChar:8},
69-
ui: {showVerdictsInsideProgressBar:true}
69+
ui: {showVerdictsInsideProgressBar:true,showErrors:true}
7070
};
7171
$('#password').pwstrength(options);
7272
});
7373
7474
function register(){
7575
event.preventDefault();
7676
$(".alert").html("").hide();
77+
$(".error-list").html("");
7778
if($("#password").val() != $("#matchPassword").val()){
7879
$("#globalError").show().html("Password mismatch");
7980
return;

spring-security-login-and-registration/src/main/webapp/WEB-INF/view/successRegister.jsp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,17 @@
99
<html>
1010

1111
<head>
12-
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet">
12+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
1313
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
1414
<title><spring:message code="label.pages.home.title"></spring:message></title>
1515
</head>
1616
<body>
17-
<div class="container">
18-
<div class="span12">
19-
<div id="success">
17+
<div class="container">
18+
<h1 class="alert alert-success">
2019
<spring:message code="message.regSucc"></spring:message>
21-
</div>
22-
<a href="<c:url value="login.html" />"><spring:message
20+
</h1>
21+
<a href="<c:url value="/login.html" />"><spring:message
2322
code="label.login"></spring:message></a>
24-
</div>
2523
</div>
2624
</body>
2725
</html>

0 commit comments

Comments
 (0)