mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-18 22:55:15 +08:00
configs mostly working. Need to add in public dns default check.
This commit is contained in:
@@ -2,9 +2,8 @@ package functions
|
||||
|
||||
import (
|
||||
"time"
|
||||
"os"
|
||||
"github.com/gravitl/netmaker/config"
|
||||
"github.com/gravitl/netmaker/models"
|
||||
"github.com/gravitl/netmaker/servercfg"
|
||||
"github.com/dgrijalva/jwt-go"
|
||||
)
|
||||
|
||||
@@ -51,7 +50,7 @@ func CreateUserJWT(username string, isadmin bool) (response string, err error) {
|
||||
func VerifyUserToken(tokenString string) (username string, isadmin bool, err error) {
|
||||
claims := &models.UserClaims{}
|
||||
|
||||
if tokenString == config.Config.Server.MasterKey || (tokenString == os.Getenv("MASTER_KEY") && tokenString != "") {
|
||||
if tokenString == servercfg.GetMasterKey() {
|
||||
return "masteradministrator", true, nil
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ func VerifyToken(tokenString string) (macaddress string, network string, err err
|
||||
|
||||
//this may be a stupid way of serving up a master key
|
||||
//TODO: look into a different method. Encryption?
|
||||
if tokenString == config.Config.Server.MasterKey || (tokenString == os.Getenv("MASTER_KEY") && tokenString != "") {
|
||||
if tokenString == servercfg.GetMasterKey() {
|
||||
return "mastermac", "", nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user