fix redirection error

This commit is contained in:
DOHA 2015-04-02 13:36:05 +02:00
parent 2ebf9bea07
commit 0e2451c30d
3 changed files with 12 additions and 13 deletions

View File

@ -31,17 +31,17 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
} }
@Override @Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception { protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(authProvider()); auth.authenticationProvider(authProvider());
} }
@Override @Override
public void configure(WebSecurity web) throws Exception { public void configure(final WebSecurity web) throws Exception {
web.ignoring().antMatchers("/resources/**"); web.ignoring().antMatchers("/resources/**");
} }
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(final HttpSecurity http) throws Exception {
// @formatter:off // @formatter:off
http http
.csrf().disable() .csrf().disable()
@ -49,7 +49,7 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/j_spring_security_check*","/login*", "/logout*", "/signin/**", "/signup/**", .antMatchers("/j_spring_security_check*","/login*", "/logout*", "/signin/**", "/signup/**",
"/user/registration*", "/regitrationConfirm*", "/expiredAccount*", "/registration*", "/user/registration*", "/regitrationConfirm*", "/expiredAccount*", "/registration*",
"/badUser*", "/user/resendRegistrationToken*" ,"/forgetPassword*", "/user/resetPassword*", "/badUser*", "/user/resendRegistrationToken*" ,"/forgetPassword*", "/user/resetPassword*",
"/user/changePassword*", "/emailError*", "/resources/**","/old/user/registration*").permitAll() "/user/changePassword*", "/emailError*", "/resources/**","/old/user/registration*","/successRegister*").permitAll()
.antMatchers("/invalidSession*").anonymous() .antMatchers("/invalidSession*").anonymous()
.anyRequest().authenticated() .anyRequest().authenticated()
.and() .and()
@ -80,7 +80,7 @@ public class SecSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean @Bean
public DaoAuthenticationProvider authProvider() { public DaoAuthenticationProvider authProvider() {
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider(); final DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
authProvider.setUserDetailsService(userDetailsService); authProvider.setUserDetailsService(userDetailsService);
authProvider.setPasswordEncoder(encoder()); authProvider.setPasswordEncoder(encoder());
return authProvider; return authProvider;

View File

@ -66,7 +66,7 @@ color:#000;
$(document).ready(function () { $(document).ready(function () {
options = { options = {
common: {minChar:8}, common: {minChar:8},
ui: {showVerdictsInsideProgressBar:true} ui: {showVerdictsInsideProgressBar:true,showErrors:true}
}; };
$('#password').pwstrength(options); $('#password').pwstrength(options);
}); });
@ -74,6 +74,7 @@ $(document).ready(function () {
function register(){ function register(){
event.preventDefault(); event.preventDefault();
$(".alert").html("").hide(); $(".alert").html("").hide();
$(".error-list").html("");
if($("#password").val() != $("#matchPassword").val()){ if($("#password").val() != $("#matchPassword").val()){
$("#globalError").show().html("Password mismatch"); $("#globalError").show().html("Password mismatch");
return; return;

View File

@ -9,19 +9,17 @@
<html> <html>
<head> <head>
<link href="<c:url value="/resources/bootstrap.css" />" rel="stylesheet"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title><spring:message code="label.pages.home.title"></spring:message></title> <title><spring:message code="label.pages.home.title"></spring:message></title>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="span12"> <h1 class="alert alert-success">
<div id="success">
<spring:message code="message.regSucc"></spring:message> <spring:message code="message.regSucc"></spring:message>
</div> </h1>
<a href="<c:url value="login.html" />"><spring:message <a href="<c:url value="/login.html" />"><spring:message
code="label.login"></spring:message></a> code="label.login"></spring:message></a>
</div>
</div> </div>
</body> </body>
</html> </html>