diff options
-rw-r--r-- | bridge/rocketchat/helpers.go | 3 | ||||
-rw-r--r-- | matterbridge.toml.sample | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/bridge/rocketchat/helpers.go b/bridge/rocketchat/helpers.go index 9fca4a6d..936f631c 100644 --- a/bridge/rocketchat/helpers.go +++ b/bridge/rocketchat/helpers.go @@ -58,6 +58,9 @@ func (b *Brocketchat) doConnectWebhookURL() error { func (b *Brocketchat) apiLogin() error { b.Log.Debugf("handling apiLogin()") credentials := &models.UserCredentials{Email: b.GetString("login"), Password: b.GetString("password")} + if b.GetString("Token") != "" { + credentials = &models.UserCredentials{ID: b.GetString("Login"), Token: b.GetString("Token")} + } myURL, err := url.Parse(b.GetString("server")) if err != nil { return err diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index de75c8df..61c86176 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -956,6 +956,11 @@ Server="https://yourrocketchatserver.domain.com:443" #REQUIRED (when not using webhooks) Login="yourlogin@domain.com" Password="yourpass" +# When using access token set Login to the User ID associated with your token and Token to your token. +# When Token is set Password is ignored. +# Login="yOurUSerID" +# Token="YoUrUsER_toKEN" + #### Settings for webhook matterbridge. #USE DEDICATED BOT USER WHEN POSSIBLE! This allows you to use advanced features like message editing/deleting and uploads |