add port to token

This commit is contained in:
afeiszli
2021-06-01 19:28:01 +00:00
parent 742f019f9b
commit 1c6b8f8a2b
4 changed files with 5 additions and 2 deletions

View File

@@ -631,8 +631,9 @@ func CreateAccessKey(accesskey models.AccessKey, network models.Network) (models
netID := network.NetID
grpcaddress := servercfg.GetGRPCHost() + ":" + servercfg.GetGRPCPort()
apiaddress := servercfg.GetAPIHost() + ":" + servercfg.GetAPIPort()
wgport := servercfg.GetGRPWGCPort()
accessstringdec := grpcaddress + "|" + apiaddress + "|" + netID + "|" + accesskey.Value + "|" + privAddr
accessstringdec := wgport + "|" +grpcaddress + "|" + apiaddress + "|" + netID + "|" + accesskey.Value + "|" + privAddr
accesskey.AccessString = base64.StdEncoding.EncodeToString([]byte(accessstringdec))
//validate accesskey
v := validator.New()