mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-27 09:36:08 +08:00
adapted node routes further to new id
This commit is contained in:
parent
73c982b9fa
commit
0f657b4378
2 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ func nodeHandlers(r *mux.Router) {
|
|||
r.HandleFunc("/api/nodes/{network}/{nodeid}/createingress", securityCheck(false, http.HandlerFunc(createIngressGateway))).Methods("POST")
|
||||
r.HandleFunc("/api/nodes/{network}/{nodeid}/deleteingress", securityCheck(false, http.HandlerFunc(deleteIngressGateway))).Methods("DELETE")
|
||||
r.HandleFunc("/api/nodes/{network}/{nodeid}/approve", authorize(true, "user", http.HandlerFunc(uncordonNode))).Methods("POST")
|
||||
// r.HandleFunc("/api/nodes/{network}", createNode).Methods("POST")
|
||||
r.HandleFunc("/api/nodes/{network}", createNode).Methods("POST")
|
||||
r.HandleFunc("/api/nodes/adm/{network}/lastmodified", authorize(true, "network", http.HandlerFunc(getLastModified))).Methods("GET")
|
||||
r.HandleFunc("/api/nodes/adm/{network}/authenticate", authenticate).Methods("POST")
|
||||
|
||||
|
|
|
@ -105,10 +105,10 @@ func CreateNode(node *models.Node) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// TODO: This covers legacy nodes, eventually want to remove legacy check
|
||||
if (node.IsServer != "yes" && (node.ID == "" || strings.Contains(node.ID, "###"))) || (node.IsServer == "yes" && servercfg.GetNodeID() == "") {
|
||||
node.ID = uuid.NewString()
|
||||
}
|
||||
logger.Log(0, "server ID: ", node.ID)
|
||||
|
||||
//Create a JWT for the node
|
||||
tokenString, _ := CreateJWT(node.ID, node.MacAddress, node.Network)
|
||||
|
|
Loading…
Reference in a new issue