summaryrefslogtreecommitdiffstats
path: root/bridge/rocketchat
diff options
context:
space:
mode:
authorMichal Suchánek <hramrach@gmail.com>2019-09-13 23:41:02 +0200
committerWim <wim@42.be>2019-09-13 23:41:02 +0200
commit9b320cd43fc77bd537660818d050285ee05cca14 (patch)
treecffbbdb24b0248cc6ef90d9bfb565dcf3c5ee2a6 /bridge/rocketchat
parent28783a4146361381e57419aa4bcf623f7ab7b80d (diff)
downloadmatterbridge-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>
Diffstat (limited to 'bridge/rocketchat')
-rw-r--r--bridge/rocketchat/helpers.go3
1 files changed, 3 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