diff --git a/main.go b/main.go index 485cab4..014d3c3 100644 --- a/main.go +++ b/main.go @@ -95,7 +95,7 @@ func main() { log.Fatal(errors.Wrap(err, "Can't parse database.uri in the config file")) } - userSuffix := config.String("users.domain") + userSuffix := strings.Trim(config.String("users.domain"), "@") if userSuffix == "" { log.Fatal("users.domain must be set in the configuration file") } @@ -139,7 +139,7 @@ func main() { log.Infof("NATS queue is %s", *natsQueue) log.Infof("--report-overages is %t", *reportOverages) - natsClient := natscl.NewClient(natsConn, userSuffix, serviceName) + natsClient := natscl.NewClient(natsConn, serviceName) a := app.New(natsClient, dbconn, userSuffix) diff --git a/natscl/natscl.go b/natscl/natscl.go index 399934d..84a8110 100644 --- a/natscl/natscl.go +++ b/natscl/natscl.go @@ -103,14 +103,12 @@ func NewConnection(settings *ConnectionSettings) (*nats.EncodedConn, error) { type Client struct { conn *nats.EncodedConn subscriptions []*nats.Subscription - userSuffix string queueSuffix string } -func NewClient(conn *nats.EncodedConn, userSuffix, queueSuffix string) *Client { +func NewClient(conn *nats.EncodedConn, queueSuffix string) *Client { return &Client{ conn: conn, - userSuffix: userSuffix, queueSuffix: queueSuffix, subscriptions: make([]*nats.Subscription, 0), }