summaryrefslogtreecommitdiffstats
path: root/store/sql_session_store.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-07-21 08:36:11 -0800
committerJoram Wilander <jwawilander@gmail.com>2016-07-21 12:36:11 -0400
commit946302d9a29cbf5702da9e18a52b59864a18c69e (patch)
tree2cd2520fc57c2a0681cc938b5e1adcd7b01c8d44 /store/sql_session_store.go
parentbfa04c0ab0eca5d812ad64e5f51e95ec458cf0d3 (diff)
downloadchat-946302d9a29cbf5702da9e18a52b59864a18c69e.tar.gz
chat-946302d9a29cbf5702da9e18a52b59864a18c69e.tar.bz2
chat-946302d9a29cbf5702da9e18a52b59864a18c69e.zip
PLT-3691 Fixing mobile session (#3652)
* PLT-3691 Fixing mobile session * Fixing unit tests
Diffstat (limited to 'store/sql_session_store.go')
-rw-r--r--store/sql_session_store.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/store/sql_session_store.go b/store/sql_session_store.go
index 9ad3a5efa..94694267c 100644
--- a/store/sql_session_store.go
+++ b/store/sql_session_store.go
@@ -283,12 +283,12 @@ func (me SqlSessionStore) UpdateRoles(userId, roles string) StoreChannel {
return storeChannel
}
-func (me SqlSessionStore) UpdateDeviceId(id, deviceId string) StoreChannel {
+func (me SqlSessionStore) UpdateDeviceId(id string, deviceId string, expiresAt int64) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
result := StoreResult{}
- if _, err := me.GetMaster().Exec("UPDATE Sessions SET DeviceId = :DeviceId WHERE Id = :Id", map[string]interface{}{"DeviceId": deviceId, "Id": id}); err != nil {
+ if _, err := me.GetMaster().Exec("UPDATE Sessions SET DeviceId = :DeviceId, ExpiresAt = :ExpiresAt WHERE Id = :Id", map[string]interface{}{"DeviceId": deviceId, "Id": id, "ExpiresAt": expiresAt}); err != nil {
result.Err = model.NewLocAppError("SqlSessionStore.UpdateDeviceId", "store.sql_session.update_device_id.app_error", nil, err.Error())
} else {
result.Data = deviceId