mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
set 10 hours for token max age
This commit is contained in:
@@ -63,6 +63,8 @@ import sonia.scm.util.HttpUtil;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -180,6 +182,9 @@ public class AuthenticationResource
|
||||
Cookie c = new Cookie("X-Bearer-Token", token);
|
||||
|
||||
c.setPath(request.getContextPath());
|
||||
|
||||
// TODO: should be configureable
|
||||
c.setMaxAge((int) TimeUnit.SECONDS.convert(10, TimeUnit.HOURS));
|
||||
c.setHttpOnly(true);
|
||||
response.addCookie(c);
|
||||
state = stateFactory.createState(subject);
|
||||
|
||||
Reference in New Issue
Block a user