diff --git a/functions/helpers.go b/functions/helpers.go index 52f74b47..389daf36 100644 --- a/functions/helpers.go +++ b/functions/helpers.go @@ -55,33 +55,25 @@ func CreateServerToken(netID string) (string, error) { } var accessToken models.AccessToken - servervals := models.ServerConfig{ - APIConnString: "127.0.0.1" + servercfg.GetAPIPort(), - GRPCConnString: "127.0.0.1" + servercfg.GetGRPCPort(), - GRPCSSL: "off", + servervals := models.ServerConfig{ + APIConnString: "127.0.0.1" + servercfg.GetAPIPort(), + GRPCConnString: "127.0.0.1" + servercfg.GetGRPCPort(), + GRPCSSL: "off", } - accessToken.ServerConfig = servervals - accessToken.ClientConfig.Network = netID - accessToken.ClientConfig.Key = GenKey() + accessToken.ServerConfig = servervals + accessToken.ClientConfig.Network = netID + accessToken.ClientConfig.Key = GenKey() accesskey.Name = GenKeyName() accesskey.Value = GenKey() accesskey.Uses = 1 -<<<<<<< HEAD - privAddr := "" - if *network.IsLocal { - privAddr = network.LocalRange + tokenjson, err := json.Marshal(accessToken) + if err != nil { + return accesskey.AccessString, err } - accessstringdec := address + "|" + address + "|" + address + "|" + netID + "|" + accesskey.Value + "|" + privAddr -======= - tokenjson, err := json.Marshal(accessToken) - if err != nil { - return accesskey.AccessString, err - } ->>>>>>> 35826caa6fb2dfe3dbe65d25799d243f5a444999 - accesskey.AccessString = base64.StdEncoding.EncodeToString([]byte(tokenjson)) + accesskey.AccessString = base64.StdEncoding.EncodeToString([]byte(tokenjson)) network.AccessKeys = append(network.AccessKeys, accesskey)