diff options
Diffstat (limited to 'src/main/java/com/gitblit/auth/WindowsAuthProvider.java')
-rw-r--r-- | src/main/java/com/gitblit/auth/WindowsAuthProvider.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/com/gitblit/auth/WindowsAuthProvider.java b/src/main/java/com/gitblit/auth/WindowsAuthProvider.java index d455d58f..93cae046 100644 --- a/src/main/java/com/gitblit/auth/WindowsAuthProvider.java +++ b/src/main/java/com/gitblit/auth/WindowsAuthProvider.java @@ -29,7 +29,6 @@ import com.gitblit.Constants.AccountType; import com.gitblit.Keys; import com.gitblit.auth.AuthenticationProvider.UsernamePasswordAuthenticationProvider; import com.gitblit.models.UserModel; -import com.gitblit.utils.ArrayUtils; import com.gitblit.utils.StringUtils; import com.sun.jna.platform.win32.Win32Exception; @@ -136,13 +135,13 @@ public class WindowsAuthProvider extends UsernamePasswordAuthenticationProvider } UserModel user = userManager.getUserModel(username); - if (user == null) // create user object for new authenticated user + if (user == null) { + // create user object for new authenticated user user = new UserModel(username.toLowerCase()); + } // create a user cookie - if (StringUtils.isEmpty(user.cookie) && !ArrayUtils.isEmpty(password)) { - user.cookie = StringUtils.getSHA1(user.username + new String(password)); - } + setCookie(user, password); // update user attributes from Windows identity user.accountType = getAccountType(); |