diff --git a/livestream/main.go b/livestream/main.go index 3c1fd3487d2..b14d3f94e70 100644 --- a/livestream/main.go +++ b/livestream/main.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "errors" + "fmt" "log" "net/http" "strconv" @@ -124,12 +125,7 @@ func main() { if err != nil { return err } - teamIdInt := int(claims["team_id"].(float64)) - - token, err := tokenFromTeamId(teamIdInt) - if err != nil { - return err - } + token := fmt.Sprint(claims["api_token"]) var hash *expirable.LRU[string, string] var ok bool @@ -175,6 +171,7 @@ func main() { return err } teamId = strconv.Itoa(int(claims["team_id"].(float64))) + token = fmt.Sprint(claims["api_token"]) log.Printf("~~~~ team found %s", teamId) if teamId == "" { @@ -182,19 +179,6 @@ func main() { } } - if teamId != "" { - teamIdInt64, err := strconv.ParseInt(teamId, 10, 0) - if err != nil { - return err - } - - teamIdInt := int(teamIdInt64) - token, err = tokenFromTeamId(teamIdInt) - if err != nil { - return err - } - } - eventTypes := []string{} if eventType != "" { eventTypes = strings.Split(eventType, ",")