@Kshitij-Katiyar This is where much of the functionality was added in this PR. I'm thinking we can test this function and `CheckUserConnected` directly. What do you think?
We basically want to emulate this in a test since this is the code that is applied throughout the PR:
if !c.tokenHelpers.CheckUserConnected(c.mattermostUserID) {
c.Logger.Warnf(LogUserInactive, c.mattermostUserID)
return nil, errors.New(ErrorUserInactive)
}
err := someCallToAPI // this can be whatever we want in the test
if err != nil {
c.tokenHelpers.DisconnectUserFromStoreIfNecessary(err, c.mattermostUserID)
We can use a "real" KV store in the test with one of the following strategies:
Originally posted by @mickmister in #256 (comment)