diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-05 11:13:25 -0600 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-05 11:13:25 -0600 |
commit | bd4314e977b883c1bffe4f593e187a1c62abbfec (patch) | |
tree | 89a29cb769efc36eff1fb3a99607004a6ce9cb91 /api/user.go | |
parent | e432b66641b9f11e505a8497efaeea53ab4b6ce0 (diff) | |
download | chat-bd4314e977b883c1bffe4f593e187a1c62abbfec.tar.gz chat-bd4314e977b883c1bffe4f593e187a1c62abbfec.tar.bz2 chat-bd4314e977b883c1bffe4f593e187a1c62abbfec.zip |
PLT-1558 adding session length to config file
Diffstat (limited to 'api/user.go')
-rw-r--r-- | api/user.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/user.go b/api/user.go index 42a65c934..d4c7fcaf5 100644 --- a/api/user.go +++ b/api/user.go @@ -492,11 +492,11 @@ func Login(c *Context, w http.ResponseWriter, r *http.Request, user *model.User, session := &model.Session{UserId: user.Id, TeamId: user.TeamId, Roles: user.Roles, DeviceId: deviceId, IsOAuth: false} - maxAge := model.SESSION_TIME_WEB_IN_SECS + maxAge := *utils.Cfg.ServiceSettings.SessionLengthWebInDays * 60 * 60 * 24 if len(deviceId) > 0 { - session.SetExpireInDays(model.SESSION_TIME_MOBILE_IN_DAYS) - maxAge = model.SESSION_TIME_MOBILE_IN_SECS + session.SetExpireInDays(*utils.Cfg.ServiceSettings.SessionLengthMobileInDays) + maxAge = *utils.Cfg.ServiceSettings.SessionLengthMobileInDays * 60 * 60 * 24 // A special case where we logout of all other sessions with the same Id if result := <-Srv.Store.Session().GetSessions(user.Id); result.Err != nil { @@ -518,7 +518,7 @@ func Login(c *Context, w http.ResponseWriter, r *http.Request, user *model.User, } } else { - session.SetExpireInDays(model.SESSION_TIME_WEB_IN_DAYS) + session.SetExpireInDays(*utils.Cfg.ServiceSettings.SessionLengthWebInDays) } ua := user_agent.New(r.UserAgent()) |