feat: add auth, hosts, & keychains ownership

This commit is contained in:
2024-11-10 18:49:35 +07:00
parent b2cc6778a6
commit 38e81049a1
31 changed files with 579 additions and 92 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"github.com/gofiber/fiber/v2"
)
func Router(app *fiber.App) {
func Router(app fiber.Router) {
router := app.Group("/ws")
router.Use(func(c *fiber.Ctx) error {
+2 -1
View File
@@ -13,7 +13,8 @@ import (
func HandleTerm(c *websocket.Conn) {
hostId := c.Query("hostId")
hostRepo := hosts.NewRepository()
user := utils.GetUserWs(c)
hostRepo := hosts.NewRepository(&hosts.Hosts{User: user})
data, err := hostRepo.Get(hostId)
if data == nil {