diff options
author | Michal Suchánek <hramrach@gmail.com> | 2019-09-13 23:41:02 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2019-09-13 23:41:02 +0200 |
commit | 9b320cd43fc77bd537660818d050285ee05cca14 (patch) | |
tree | cffbbdb24b0248cc6ef90d9bfb565dcf3c5ee2a6 | |
parent | 28783a4146361381e57419aa4bcf623f7ab7b80d (diff) | |
download | matterbridge-msglm-9b320cd43fc77bd537660818d050285ee05cca14.tar.gz matterbridge-msglm-9b320cd43fc77bd537660818d050285ee05cca14.tar.bz2 matterbridge-msglm-9b320cd43fc77bd537660818d050285ee05cca14.zip |
Add token support (RocketChat) (#892)
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
-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 |