Store Mattermost session token in Redis

At the moment, when interacting with mattermost. We set up a session for each request, so for MattermostController#new we preload the teams the users is a member off, we setup a session, request the needed data, invalidate the token on Mattermost (effectively logging out). If the user wants to set up the slash commands a minute later, we setup a session again, create a new resource and invalidate that session again.

However, this could be done with the same token, as the session valid for 30 days. (although this depends on the configuration of Mattermost)

What I propose is to store valid session keys in Redis, so there is no need to setup the session again, and tear it down. Setting up a session would save us 2 round trips, not tearing down another one.

What is you opinion @briann @ayufan

Assignee Loading
Time tracking Loading