Browse Source

remove autoenabling rac configs

abhishek9686 1 week ago
parent
commit
d256707e85
1 changed files with 0 additions and 36 deletions
  1. 0 36
      controllers/user.go

+ 0 - 36
controllers/user.go

@@ -415,42 +415,6 @@ func authenticateUser(response http.ResponseWriter, request *http.Request) {
 	response.Header().Set("Content-Type", "application/json")
 	response.Header().Set("Content-Type", "application/json")
 	response.Write(successJSONResponse)
 	response.Write(successJSONResponse)
 
 
-	go func() {
-		if servercfg.IsPro {
-			// enable all associeated clients for the user
-			clients, err := logic.GetAllExtClients()
-			if err != nil {
-				slog.Error("error getting clients: ", "error", err)
-				return
-			}
-			for _, client := range clients {
-				if client.OwnerID == username && !client.Enabled {
-					slog.Info(
-						fmt.Sprintf(
-							"enabling ext client %s for user %s due to RAC autodisabling feature",
-							client.ClientID,
-							client.OwnerID,
-						),
-					)
-					if newClient, err := logic.ToggleExtClientConnectivity(&client, true); err != nil {
-						slog.Error(
-							"error enabling ext client in RAC autodisable hook",
-							"error",
-							err,
-						)
-						continue // dont return but try for other clients
-					} else {
-						// publish peer update to ingress gateway
-						if ingressNode, err := logic.GetNodeByID(newClient.IngressGatewayID); err == nil {
-							if err = mq.PublishPeerUpdate(false); err != nil {
-								slog.Error("error updating ext clients on", "ingress", ingressNode.ID.String(), "err", err.Error())
-							}
-						}
-					}
-				}
-			}
-		}
-	}()
 }
 }
 
 
 // @Summary     Validates a user's identity against it's token. This is used by UI before a user performing a critical operation to validate the user's identity.
 // @Summary     Validates a user's identity against it's token. This is used by UI before a user performing a critical operation to validate the user's identity.