From b91fa1d01d5f637db9976b4429959409c039a3c5 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 29 Jan 2025 01:53:15 +0800 Subject: [PATCH] :bug: Fix panic issue --- pkg/internal/server/api/wallet_api.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/internal/server/api/wallet_api.go b/pkg/internal/server/api/wallet_api.go index 1f15884..33b66c4 100644 --- a/pkg/internal/server/api/wallet_api.go +++ b/pkg/internal/server/api/wallet_api.go @@ -2,6 +2,7 @@ package api import ( "errors" + "git.solsynth.dev/hypernet/wallet/pkg/internal/server/exts" "git.solsynth.dev/hypernet/nexus/pkg/nex/sec" @@ -16,7 +17,7 @@ func createWallet(c *fiber.Ctx) error { if err := sec.EnsureGrantedPerm(c, "CreateWallet", true); err != nil { return err } - user := c.Locals("user").(*sec.UserInfo) + user := c.Locals("nex_user").(*sec.UserInfo) var data struct { Password string `json:"password" validate:"min=4"` @@ -48,7 +49,7 @@ func getMyWallet(c *fiber.Ctx) error { if err := sec.EnsureAuthenticated(c); err != nil { return err } - user := c.Locals("user").(*sec.UserInfo) + user := c.Locals("nex_user").(*sec.UserInfo) var wallet models.Wallet if err := database.C.Where("account_id = ?", user.ID).First(&wallet).Error; err != nil {