mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-11 09:10:53 +08:00
fixed name issue
This commit is contained in:
parent
4f9ce3635a
commit
0bdaaf8b63
1 changed files with 5 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/gravitl/netmaker/database"
|
||||
|
|
@ -65,7 +66,7 @@ func securityCheck(reqAdmin bool, next http.Handler) http.HandlerFunc {
|
|||
}
|
||||
}
|
||||
|
||||
func SecurityCheck(reqAdmin bool, netname, token string) (error, []string, string) {
|
||||
func SecurityCheck(reqAdmin bool, netname string, token string) (error, []string, string) {
|
||||
|
||||
var hasBearer = true
|
||||
var tokenSplit = strings.Split(token, " ")
|
||||
|
|
@ -94,7 +95,7 @@ func SecurityCheck(reqAdmin bool, netname, token string) (error, []string, strin
|
|||
userNetworks = []string{ALL_NETWORK_ACCESS}
|
||||
} else {
|
||||
networkexists, err := functions.NetworkExists(netname)
|
||||
if err != nil {
|
||||
if err != nil && !database.IsEmptyRecord(err) {
|
||||
return err, nil, ""
|
||||
}
|
||||
if netname != "" && !networkexists {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue