fixed server node problems

This commit is contained in:
afeiszli
2021-06-01 01:13:25 +00:00
parent 963a3d1b92
commit 71799992ff
2 changed files with 4 additions and 10 deletions

View File

@@ -27,7 +27,6 @@ import (
//node has that value for the same field within the network
func CreateServerToken(netID string) (string, error) {
fmt.Println("Creating token.")
var network models.Network
var accesskey models.AccessKey
@@ -46,12 +45,10 @@ func CreateServerToken(netID string) (string, error) {
privAddr = network.LocalRange
}
accessstringdec := address + "|" + netID + "|" + accesskey.Value + "|" + privAddr
accessstringdec := address + "|" + address + "|" + netID + "|" + accesskey.Value + "|" + privAddr
accesskey.AccessString = base64.StdEncoding.EncodeToString([]byte(accessstringdec))
fmt.Println(" access string: " + accesskey.AccessString)
network.AccessKeys = append(network.AccessKeys, accesskey)
collection := mongoconn.Client.Database("netmaker").Collection("networks")