diff options
author | Wim <wim@42.be> | 2017-08-16 23:37:37 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-08-16 23:37:37 +0200 |
commit | b963f83c6a09da1eaf02eb9f269c6f5881a0c711 (patch) | |
tree | 5ec37162046349d23c627e9ee26fb70c1a6c4f08 /vendor/github.com/mattermost/platform/model/session.go | |
parent | f6297ebbb09611165a50a6cd15abf6499268cf86 (diff) | |
download | matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.tar.gz matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.tar.bz2 matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.zip |
Update mattermost vendor (3.7 => 4.1)
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/session.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/session.go | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/vendor/github.com/mattermost/platform/model/session.go b/vendor/github.com/mattermost/platform/model/session.go index 277e910f..960c18cb 100644 --- a/vendor/github.com/mattermost/platform/model/session.go +++ b/vendor/github.com/mattermost/platform/model/session.go @@ -1,4 +1,4 @@ -// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. package model @@ -10,11 +10,17 @@ import ( ) const ( - SESSION_COOKIE_TOKEN = "MMAUTHTOKEN" - SESSION_CACHE_SIZE = 35000 - SESSION_PROP_PLATFORM = "platform" - SESSION_PROP_OS = "os" - SESSION_PROP_BROWSER = "browser" + SESSION_COOKIE_TOKEN = "MMAUTHTOKEN" + SESSION_COOKIE_USER = "MMUSERID" + SESSION_CACHE_SIZE = 35000 + SESSION_PROP_PLATFORM = "platform" + SESSION_PROP_OS = "os" + SESSION_PROP_BROWSER = "browser" + SESSION_PROP_TYPE = "type" + SESSION_PROP_USER_ACCESS_TOKEN_ID = "user_access_token_id" + SESSION_TYPE_USER_ACCESS_TOKEN = "UserAccessToken" + SESSION_ACTIVITY_TIMEOUT = 1000 * 60 * 5 // 5 minutes + SESSION_USER_ACCESS_TOKEN_EXPIRY = 100 * 365 // 100 years ) type Session struct { @@ -56,7 +62,9 @@ func (me *Session) PreSave() { me.Id = NewId() } - me.Token = NewId() + if me.Token == "" { + me.Token = NewId() + } me.CreateAt = GetMillis() me.LastActivityAt = me.CreateAt |