summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/auth
diff options
context:
space:
mode:
authorRodrigo Andrade <rodrigo_cardoso@hotmail.it>2016-08-15 18:20:28 -0300
committerRodrigo Andrade <rodrigo_cardoso@hotmail.it>2016-08-15 18:20:28 -0300
commitb453703aa83f9e3b1605190aed3356fec9d46155 (patch)
treef9ad789bcf0a8c56575f17570cf298c7f943efba /src/main/java/com/gitblit/auth
parent9b8049057430592206cfb242ec24bde4ab7cb438 (diff)
downloadgitblit-b453703aa83f9e3b1605190aed3356fec9d46155.tar.gz
gitblit-b453703aa83f9e3b1605190aed3356fec9d46155.zip
removing duplicated code for cookie genaration and adding random bytes to generate user cookies
Diffstat (limited to 'src/main/java/com/gitblit/auth')
-rw-r--r--src/main/java/com/gitblit/auth/AuthenticationProvider.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/auth/AuthenticationProvider.java b/src/main/java/com/gitblit/auth/AuthenticationProvider.java
index 0bfe2351..6c098859 100644
--- a/src/main/java/com/gitblit/auth/AuthenticationProvider.java
+++ b/src/main/java/com/gitblit/auth/AuthenticationProvider.java
@@ -81,7 +81,7 @@ public abstract class AuthenticationProvider {
protected void setCookie(UserModel user, char [] password) {
// create a user cookie
if (StringUtils.isEmpty(user.cookie) && !ArrayUtils.isEmpty(password)) {
- user.cookie = StringUtils.getSHA1(user.username + new String(password));
+ user.cookie = user.createCookie();
}
}