|
@@ -56,8 +56,9 @@ func CreateJWT(uuid string, macAddress string, network string) (response string,
|
|
|
func CreateUserJWT(username string, role models.UserRoleID) (response string, err error) {
|
|
|
expirationTime := time.Now().Add(servercfg.GetServerConfig().JwtValidityDuration)
|
|
|
claims := &models.UserClaims{
|
|
|
- UserName: username,
|
|
|
- Role: role,
|
|
|
+ UserName: username,
|
|
|
+ Role: role,
|
|
|
+ RacAutoDisable: servercfg.GetRacAutoDisable() && (role != models.SuperAdminRole && role != models.AdminRole),
|
|
|
RegisteredClaims: jwt.RegisteredClaims{
|
|
|
Issuer: "Netmaker",
|
|
|
Subject: fmt.Sprintf("user|%s", username),
|