commit
14849eb88f
|
@ -51,10 +51,6 @@ public class MyUserDetailsService implements UserDetailsService {
|
||||||
enabled = false;
|
enabled = false;
|
||||||
return new org.springframework.security.core.userdetails.User(" ", " ", enabled, true, true, true, getAuthorities(new Integer(1)));
|
return new org.springframework.security.core.userdetails.User(" ", " ", enabled, true, true, true, getAuthorities(new Integer(1)));
|
||||||
}
|
}
|
||||||
if (user.isTokenExpired()) {
|
|
||||||
accountNonExpired = false;
|
|
||||||
return new org.springframework.security.core.userdetails.User(" ", " ", enabled, accountNonExpired, true, true, getAuthorities(new Integer(1)));
|
|
||||||
}
|
|
||||||
return new org.springframework.security.core.userdetails.User(user.getEmail(), user.getPassword().toLowerCase(), enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, getAuthorities(user.getRole().getRole()));
|
return new org.springframework.security.core.userdetails.User(user.getEmail(), user.getPassword().toLowerCase(), enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, getAuthorities(user.getRole().getRole()));
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -64,7 +64,8 @@ public class RegistrationController {
|
||||||
User user = verificationToken.getUser();
|
User user = verificationToken.getUser();
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
if ((verificationToken.getExpiryDate().getTime() - cal.getTime().getTime()) <= 0) {
|
if ((verificationToken.getExpiryDate().getTime() - cal.getTime().getTime()) <= 0) {
|
||||||
user.setTokenExpired(true);
|
model.addAttribute("message", messages.getMessage("auth.message.expired", null, request.getLocale()));
|
||||||
|
return "redirect:/badUser.html?lang=" + request.getLocale().getLanguage();
|
||||||
}
|
}
|
||||||
user.setEnabled(true);
|
user.setEnabled(true);
|
||||||
service.saveRegisteredUser(user);
|
service.saveRegisteredUser(user);
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
################### DataSource Configuration ##########################
|
################### DataSource Configuration ##########################
|
||||||
jdbc.driverClassName=com.mysql.jdbc.Driver
|
jdbc.driverClassName=com.mysql.jdbc.Driver
|
||||||
jdbc.url=jdbc:mysql://localhost:3306/AUTHDATA
|
jdbc.url=jdbc:mysql://localhost:3306/spring_hibernate4_02?createDatabaseIfNotExist=true
|
||||||
jdbc.user=root
|
jdbc.user=tutorialuser
|
||||||
###jdbc.pass=admin###
|
jdbc.pass=tutorialmy5ql
|
||||||
init-db=false
|
init-db=false
|
||||||
################### Hibernate Configuration ##########################
|
################### Hibernate Configuration ##########################
|
||||||
hibernate.dialect=org.hibernate.dialect.MySQLDialect
|
hibernate.dialect=org.hibernate.dialect.MySQLDialect
|
||||||
hibernate.show_sql=true
|
hibernate.show_sql=false
|
||||||
hibernate.hbm2ddl.auto=validate
|
hibernate.hbm2ddl.auto=create-drop
|
||||||
################### JavaMail Configuration ##########################
|
################### JavaMail Configuration ##########################
|
||||||
smtp.host=smtp.gmail.com
|
smtp.host=smtp.gmail.com
|
||||||
smtp.port=465
|
smtp.port=465
|
||||||
smtp.protocol=smtps
|
smtp.protocol=smtps
|
||||||
smtp.username=xxx@gmail.com
|
smtp.username=xxx777@gmail.com
|
||||||
smtp.password=
|
smtp.password=
|
||||||
support.email=xxx@gmail.com
|
support.email=xxx777@gmail.com
|
Loading…
Reference in New Issue