Don't logout if logging in through token. (from @recht matterircd fork)

This commit is contained in:
Wim 2017-07-01 22:41:28 +02:00
parent 877f0fe2e8
commit d261949db2
1 changed files with 4 additions and 0 deletions

View File

@ -229,6 +229,10 @@ func (m *MMClient) Logout() error {
m.WsQuit = true
m.WsClient.Close()
m.WsClient.UnderlyingConn().Close()
if strings.Contains(m.Credentials.Pass, model.SESSION_COOKIE_TOKEN) {
m.log.Debug("Not invalidating session in logout, credential is a token")
return nil
}
_, err := m.Client.Logout()
if err != nil {
return err