summaryrefslogtreecommitdiffstats
path: root/matterclient/matterclient.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-08-23 22:49:42 +0200
committerWim <wim@42.be>2017-08-23 22:49:42 +0200
commit7f9a400776e0000c84e6539a932027965098d6a3 (patch)
treec81073ff26fc3a00be6219e5d2505a93fc386760 /matterclient/matterclient.go
parentce1c5873ac0684dd032658cbe57a81df0dc3a4b5 (diff)
downloadmatterbridge-msglm-7f9a400776e0000c84e6539a932027965098d6a3.tar.gz
matterbridge-msglm-7f9a400776e0000c84e6539a932027965098d6a3.tar.bz2
matterbridge-msglm-7f9a400776e0000c84e6539a932027965098d6a3.zip
Add support for personal access tokens (mattermost)
* https://docs.mattermost.com/developer/personal-access-tokens.html
Diffstat (limited to 'matterclient/matterclient.go')
-rw-r--r--matterclient/matterclient.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go
index f2ae46b0..53c7809c 100644
--- a/matterclient/matterclient.go
+++ b/matterclient/matterclient.go
@@ -140,7 +140,7 @@ func (m *MMClient) Login() error {
for {
m.log.Debugf("%s %s %s %s", logmsg, m.Credentials.Team, m.Credentials.Login, m.Credentials.Server)
if strings.Contains(m.Credentials.Pass, model.SESSION_COOKIE_TOKEN) {
- m.log.Debugf(logmsg+" with %s", model.SESSION_COOKIE_TOKEN)
+ m.log.Debugf(logmsg + " with token")
token := strings.Split(m.Credentials.Pass, model.SESSION_COOKIE_TOKEN+"=")
if len(token) != 2 {
return errors.New("incorrect MMAUTHTOKEN. valid input is MMAUTHTOKEN=yourtoken")
@@ -150,7 +150,7 @@ func (m *MMClient) Login() error {
m.Client.AuthType = model.HEADER_BEARER
m.User, resp = m.Client.GetMe("")
if resp.Error != nil {
- return errors.New(resp.Error.DetailedError)
+ return resp.Error
}
if m.User == nil {
m.log.Errorf("LOGIN TOKEN: %s is invalid", m.Credentials.Pass)