Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Revert "broker: Fatal error when a networkserver token can't be read"
Browse files Browse the repository at this point in the history
This reverts commit 33b404a.
  • Loading branch information
htdvisser committed Dec 22, 2017
1 parent 33b404a commit 8477a84
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cmd/broker.go
Expand Up @@ -17,7 +17,6 @@ import (
ttnlog "github.com/TheThingsNetwork/go-utils/log"
"github.com/TheThingsNetwork/ttn/core/broker"
"github.com/TheThingsNetwork/ttn/core/component"
"github.com/dgrijalva/jwt-go"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -57,11 +56,7 @@ var brokerCmd = &cobra.Command{
broker := broker.NewBroker(
time.Duration(viper.GetInt("broker.deduplication-delay")) * time.Millisecond,
)
nsToken := viper.GetString("broker.networkserver-token")
if _, err := jwt.Parse(nsToken, func(*jwt.Token) (interface{}, error) { return nil, nil }); nsToken != "" && err != nil {
ctx.WithError(err).Fatal("Could not read networkserver token")
}
broker.SetNetworkServer(viper.GetString("broker.networkserver-address"), nsCert, nsToken)
broker.SetNetworkServer(viper.GetString("broker.networkserver-address"), nsCert, viper.GetString("broker.networkserver-token"))
err = broker.Init(component)
if err != nil {
ctx.WithError(err).Fatal("Could not initialize broker")
Expand Down

0 comments on commit 8477a84

Please sign in to comment.