From 9b320cd43fc77bd537660818d050285ee05cca14 Mon Sep 17 00:00:00 2001 From: Michal Suchánek Date: Fri, 13 Sep 2019 23:41:02 +0200 Subject: Add token support (RocketChat) (#892) Signed-off-by: Michal Suchanek --- bridge/rocketchat/helpers.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bridge') 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 -- cgit v1.2.3