Skip to content
Snippets Groups Projects
Commit 90aaa054 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

trying to fix user auth bug

parent 54dc736c
No related branches found
No related tags found
No related merge requests found
......@@ -188,8 +188,6 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
return userAuthentication.getDetails().toString();
}
private transient User user;
/**
* returns the user for the current session.
* <p>
......@@ -203,19 +201,12 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
* @return the user for the current session
*/
public synchronized User getUser() {
if (user == null) {
if (!authentication) {
user = new User();
user.setUsername("TestUser");
} else {
user = new User(getUserInfos());
User foundUser = userRepository.findOne(user.getUsername());
if (foundUser != null) {
user.setAgreeNDA(foundUser.getAgreeNDA());
}
}
userRepository.save(user);
User user = new User(getUserInfos());
User foundUser = userRepository.findOne(user.getUsername());
if (foundUser != null) {
user.setAgreeNDA(foundUser.getAgreeNDA());
}
userRepository.save(user);
return user;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment